Interface ErrorHandler
- All Known Implementing Classes:
PropagatingErrorHandler
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
The error handler is generally invoked by an EventProcessor when
the ProcessingContext created to coordinate the event processing was
rolled back.
- Since:
- 3.0.0
- Author:
- Rene de Waele
-
Method Summary
Modifier and TypeMethodDescriptionvoidhandleError(ErrorContext errorContext) Handle an error raised during event processing.
-
Method Details
-
handleError
Handle an error raised during event processing.Generally this means that the
ProcessingContextcreated to coordinate the event processing was rolled back. Using default configuration theErrorHandleris only invoked when there is a serious error, for instance when the database transaction connected to theProcessingContextcan not be committed.The error handler has the option to simply log or ignore the error. Depending on the type of
EventProcessorthis will put an end to the processing of any further events (in case of aPooledStreamingEventProcessor) or simply skip over the list offailedEventsin the givenerrorContext.Note that although the
ProcessingContextand hence any related database transactions have been rolled back when the error handler is invoked, the processing of one or more of theErrorContext.failedEvents()may in fact have caused other side effects which could not be reverted.- Parameters:
errorContext- Contextual information describing the error.- Throws:
Exception- If this handler decides to propagate the error.
-