Enum Class PropagatingErrorHandler

java.lang.Object
java.lang.Enum<PropagatingErrorHandler>
org.axonframework.messaging.eventhandling.processing.errorhandling.PropagatingErrorHandler
All Implemented Interfaces:
Serializable, Comparable<PropagatingErrorHandler>, Constable, ErrorHandler

public enum PropagatingErrorHandler extends Enum<PropagatingErrorHandler> implements ErrorHandler
An ErrorHandler implementation that rethrows the ErrorContext exception.
Since:
3.0.0
Author:
Rene de Waele
  • Enum Constant Details

  • Method Details

    • values

      public static PropagatingErrorHandler[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static PropagatingErrorHandler valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • instance

      public static PropagatingErrorHandler instance()
      Singleton instance of a PropagatingErrorHandler.
      Returns:
      The singleton instance of PropagatingErrorHandler
    • handleError

      public void handleError(@Nonnull ErrorContext errorContext) throws Exception
      Description copied from interface: ErrorHandler
      Handle an error raised during event processing.

      Generally this means that the ProcessingContext created to coordinate the event processing was rolled back. Using default configuration the ErrorHandler is only invoked when there is a serious error, for instance when the database transaction connected to the ProcessingContext can not be committed.

      The error handler has the option to simply log or ignore the error. Depending on the type of EventProcessor this will put an end to the processing of any further events (in case of a PooledStreamingEventProcessor) or simply skip over the list of failedEvents in the given errorContext.

      Note that although the ProcessingContext and hence any related database transactions have been rolled back when the error handler is invoked, the processing of one or more of the ErrorContext.failedEvents() may in fact have caused other side effects which could not be reverted.

      Specified by:
      handleError in interface ErrorHandler
      Parameters:
      errorContext - Contextual information describing the error.
      Throws:
      Exception - If this handler decides to propagate the error.