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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
Should be implemented in subclasses if the exception class name is not enough to determine the ability to handle the exception.protected abstract void
Perform exception handling.boolean
Handle an exception.
-
Field Details
-
classNames
-
-
Constructor Details
-
AbstractUiExceptionHandler
-
-
Method Details
-
handle
Description copied from interface:UiExceptionHandler
Handle an exception. Implementation class should either handle the exception and returntrue
, or returnfalse
to delegate execution to the next handler in the chain of responsibility.- Specified by:
handle
in interfaceUiExceptionHandler
- Parameters:
exception
- throwable instance- Returns:
true
if the exception has been successfully handled,false
if 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:
true
if 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.
-