- All Known Implementing Classes:
GlobalExceptionHandlerSlf4j,GlobalExceptionHandlerSysout
public interface GlobalExceptionHandler
Interface used as fallback to
handle an error that can not be handled in a
specific way by generic components. It allows to write portable code that can delegate error handling to this
interface allowing to exchange its implementation and therefore the handling strategy.-
Method Summary
Modifier and TypeMethodDescriptionvoidhandleError(Object context, Throwable error) This method handles an error that occurred in a generic component that can not handle it in a specific way.
-
Method Details
-
handleError
This method handles an error that occurred in a generic component that can not handle it in a specific way.
In a typical server application you may like to log the errors while in a client application you might want to show a popup that displays the error.- Parameters:
context- is an Object with information about the context when the error occurred. Itsstring representationshould be human readable and give additional hints to track down the error. E.g. the source or parameters of an operation where the error occurred. This parameter may also benullif no context information is available.error- is theerrorthat has been catched and shall be handled.
-