public interface ErrorHandler<A extends Action>
Error handlers are created by the factory for each request/use of an extension point. The error handler doesn't have to be thread-safe, but must be if the factory re-uses a single instance. Whenever an exception happens during the processing of an extension, the error is re-directed to the error handler. The error handler is more or less free to do what it wants. The default implementation
LoggingErrorHandlerFactorysimply puts a message in the log. Note that it is not usually practical to let the error propagate up to the gui level.
- Last modified
- $Date: 2010-11-12 14:59:38 +0100 (fr, 12 nov 2010) $
handleErrorHandle an exception that has happened. It is up to the error handler what should happen next. Typically, error should always be logged but the error handler may choose to re-throw the exception. If the exception isn't already a runtime exception it must be wrapped.
Note that there are three stages in the extension mechanism, which may cause some of the parameters to be null:
- Extension point intialization: Eg. when the render factory is being prepared (context and action are both null)
- Extension intialization: Eg. when the action factory is being prepared (action is null)
- Extension rendering: Eg. when rendering the actions of a single extension (context and action are non-null)
context- The extension context, which can be null
action- The action that was being rendered when the error happened, which can be null
message- An optional error message
t- The error