# `Commanded.ProcessManagers.FailureContext`
[🔗](https://github.com/commanded/commanded/blob/v1.4.12/lib/commanded/process_managers/failure_context.ex#L1)

Data related to a process manager event handling or command dispatch failure.

The available fields are:

  - `context` - the context map passed between each failure and may be used
    to track state between retries, such as to count failures.

  - `enriched_metadata` - the enriched metadata associated with the event.

  - `last_event` - the last event the process manager received.

  - `pending_commands` - the pending commands that were not executed yet.

  - `process_manager_state` - the state the process manager would be in
    if the event handling or command dispatch had not failed.

  - `stacktrace` - the stacktrace if the error was an unhandled exception.

# `t`

```elixir
@type t() :: %Commanded.ProcessManagers.FailureContext{
  context: map(),
  enriched_metadata: Commanded.EventStore.RecordedEvent.enriched_metadata(),
  last_event: Commanded.EventStore.RecordedEvent.t(),
  pending_commands: [struct()],
  process_manager_state: struct(),
  stacktrace: Exception.stacktrace() | nil
}
```

---

*Consult [api-reference.md](api-reference.md) for complete listing*
