public class LoggingErrorHandler extends Object implements ListenerInvocationErrorHandler
ListenerInvocationErrorHandler
that logs exceptions as errors but otherwise does nothing
to prevent event handling from continuing.Constructor and Description |
---|
LoggingErrorHandler()
Initialize the LoggingErrorHandler using the logger for "org.axonframework.eventhandling.LoggingErrorHandler".
|
LoggingErrorHandler(org.slf4j.Logger logger)
Initialize the LoggingErrorHandler to use the given
logger to log errors |
Modifier and Type | Method and Description |
---|---|
void |
onError(Exception exception,
EventMessage<?> event,
EventMessageHandler eventHandler)
Invoked after given
eventListener failed to handle given event . |
public LoggingErrorHandler()
public LoggingErrorHandler(org.slf4j.Logger logger)
logger
to log errorslogger
- the logger to log errors withpublic void onError(@Nonnull Exception exception, @Nonnull EventMessage<?> event, @Nonnull EventMessageHandler eventHandler)
ListenerInvocationErrorHandler
eventListener
failed to handle given event
. Implementations have a
choice of options for how to continue:
EventMessageHandler.handle(EventMessage)
on the eventListener once or multiple times.onError
in interface ListenerInvocationErrorHandler
exception
- The exception thrown by the given eventListenerevent
- The event that triggered the exceptioneventHandler
- The listener that failed to handle given eventCopyright © 2010–2024. All rights reserved.