public interface ErrorHandler
Error handler interface. This interface must be implemented by an error handler. Error handlers can be registered for various components in this library and are called when an exception is encountered that cannot reasonably passed up the stack but might be of some significance and thus should not simply be ignored.
The error handler can decide how to handle the error, e.g. by showing a message to the user, printing the information on the console, or passing it on to a different component like a logging framework.
The error handler might also be called without an exception instance if library code detects abnormal situation that is not directly associated with an exception. In this case, the description provides additional information about the situation.
Modifier and Type | Method and Description |
---|---|
void |
handleError(Class<?> context,
Throwable e,
String description)
Handles an error.
|
void handleError(Class<?> context, Throwable e, String description)
Handles an error. This method is called if the library code detects an
exception that it cannot handle internally or detects another abnormal
situation. At least one of e
and description
is
guaranteed not to be null
.
This method should not throw an exception, but if it does, this exception will simply be ignored.
context
- the class that called the error handler. This information can
be used to determine in which component an exception occurred
if the same exception handler is registered for various
components.e
- exception that was encountered by library code and could not
be handled internally or null
if no exception is
available.description
- some additional information about the context in which the
error occurred or null
if no such information is
available.Copyright © 2014–2016 aquenos GmbH. All rights reserved.