# `Decree.Event.FailureContext`
[🔗](https://github.com/sparkle-space/decree/blob/v0.1.0/lib/decree/event/failure_context.ex#L1)

Data related to an event handling failure.

The available fields are:

  - `:application` - the associated `Decree.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.

# `t`

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

---

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