Package io.jmix.flowui.exception
Class AbstractUiExceptionHandler
java.lang.Object
io.jmix.flowui.exception.AbstractUiExceptionHandler
- All Implemented Interfaces:
UiExceptionHandler
- Direct Known Subclasses:
OptimisticLockExceptionHandler,SilentExceptionHandler
Base class for exception handlers determining their ability to handle an exception by its class name and optional
implementation of
canHandle(String, String, Throwable) method.
If you need to handle a specific exception, create a descendant of this class,
pass handled exception class names into constructor, implement
doHandle(String, String, Throwable) method and annotate the class with @Component.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanShould be implemented in subclasses if the exception class name is not enough to determine the ability to handle the exception.protected abstract voidPerform exception handling.booleanHandle an exception.
-
Field Details
-
classNames
-
-
Constructor Details
-
AbstractUiExceptionHandler
-
-
Method Details
-
handle
Description copied from interface:UiExceptionHandlerHandle an exception. Implementation class should either handle the exception and returntrue, or returnfalseto delegate execution to the next handler in the chain of responsibility.- Specified by:
handlein interfaceUiExceptionHandler- Parameters:
exception- throwable instance- Returns:
trueif the exception has been successfully handled,falseif not
-
canHandle
Should be implemented in subclasses if the exception class name is not enough to determine the ability to handle the exception.- Parameters:
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.- Returns:
trueif the exception can be handled by this handler
-
doHandle
Perform exception handling.- Parameters:
className- 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.
-