# `MingaAgent.EventLog.Failure`
[🔗](https://github.com/jsmestad/minga/blob/main/lib/minga_agent/event_log/failure.ex#L1)

Typed, observable failure of EventLog admission or durable commitment.

# `stage`

```elixir
@type stage() :: :admission | :persistence
```

# `t`

```elixir
@type t() :: %MingaAgent.EventLog.Failure{
  event_type: MingaAgent.EventLog.EventRecord.event_type(),
  reason: term(),
  receipt: reference() | nil,
  stage: stage()
}
```

# `admission`

```elixir
@spec admission(MingaAgent.EventLog.EventRecord.event_type(), term()) :: t()
```

Builds an admission failure, which has no durability receipt.

# `persistence`

```elixir
@spec persistence(reference(), MingaAgent.EventLog.EventRecord.event_type(), term()) ::
  t()
```

Builds a post-admission persistence failure.

# `retained`

```elixir
@spec retained(t()) :: t()
```

Removes the original receipt before replaying a retained failure to a later subscriber.

---

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