Commanded v1.2.0 Commanded.Event.FailureContext View Source

Data related to an event handling failure.

The available fields are:

  • :application - the associated Commanded.Application.

  • :handler_name - the name of the event handler.

  • :handler_state - optional event handler state.

  • :context - a map that is passed between each failure. Use it to store any transient state between failures. As an example it could be used to count error failures and stop or skip the problematic event after too many.

  • :metadata - the metadata associated with the failed event.

  • :stacktrace - the stacktrace if the error was an unhandled exception.

Link to this section Summary

Link to this section Types

Specs

t() :: %Commanded.Event.FailureContext{
  application: Commanded.Application.t(),
  context: map(),
  handler_name: String.t(),
  handler_state: nil | any(),
  metadata: map(),
  stacktrace: Exception.stacktrace() | nil
}