Class ErrorContext

java.lang.Object
org.axonframework.eventhandling.ErrorContext

public class ErrorContext extends Object
Describes the context of an error.
Since:
3.0
Author:
Allard Buijze
  • Constructor Details

    • ErrorContext

      public ErrorContext(@Nonnull String eventProcessor, @Nonnull Throwable error, @Nonnull List<? extends EventMessage<?>> failedEvents)
      Instantiate an ErrorContext for the given eventProcessor, due to the given error, with the given failedEvents.
      Parameters:
      eventProcessor - the name of the event processor that failed to process the given events
      error - the error that was raised during processing
      failedEvents - the list of events that triggered the error
  • Method Details

    • eventProcessor

      public String eventProcessor()
      Returns the name of the Event Processor where the error occurred.
      Returns:
      the name of the Event Processor where the error occurred
    • error

      public Throwable error()
      Returns the error that was raised in the processor
      Returns:
      the error that was raised in the processor
    • failedEvents

      public List<? extends EventMessage<?>> failedEvents()
      The events part of the batch that failed. May be empty if an error occurred outside of the scope of processing a batch (e.g. while preparing the next batch).
      Returns:
      events part of the batch that failed, if any