public abstract class AbstractExceptionHandler extends java.lang.Object implements ExceptionHandler
canHandle(String, String, Throwable)
method.
If you need to handle a specific exception, create a descendant of this class,
pass handling exception class names into constructor, implement
doHandle(com.haulmont.cuba.web.App, String, String, Throwable)
method
and register the new handler in the definition of ExceptionHandlersConfiguration
bean in the client's
spring.xml.
Modifier | Constructor and Description |
---|---|
protected |
AbstractExceptionHandler(java.lang.String... classNames) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
canHandle(java.lang.String className,
java.lang.String message,
java.lang.Throwable throwable)
Should be implemented in subclasses if the exception class name is not enough to determine the ability to
handle the exception.
|
protected abstract void |
doHandle(App app,
java.lang.String className,
java.lang.String message,
java.lang.Throwable throwable)
Perform exception handling.
|
boolean |
handle(com.vaadin.server.ErrorEvent event,
App app)
Handle an exception.
|
protected AbstractExceptionHandler(java.lang.String... classNames)
public boolean handle(com.vaadin.server.ErrorEvent event, App app)
ExceptionHandler
handle
in interface ExceptionHandler
event
- error event containing the exception, generated by Vaadinapp
- current App
instanceprotected boolean canHandle(java.lang.String className, java.lang.String message, @Nullable java.lang.Throwable throwable)
className
- exception class namemessage
- exception messagethrowable
- exception instance. Can be null if the exception occurred on the server side and this
exception class isn't accessible by the client.protected abstract void doHandle(App app, java.lang.String className, java.lang.String message, @Nullable java.lang.Throwable throwable)
app
- current App
instanceclassName
- actual exception class namemessage
- exception messagethrowable
- exception instance. Can be null if the exception occurred on the server side and this
exception class isn't accessible by the client.