# `Accrue.EventLedgerImmutableError`
[🔗](https://github.com/szTheory/accrue/blob/accrue-v0.3.0/lib/accrue/events/ledger_immutable_error.ex#L1)

Raised when a caller attempts to UPDATE or DELETE a row in
`accrue_events`. The append-only guarantee is enforced in two places:

  1. A Postgres `BEFORE UPDATE OR DELETE` trigger raises
     SQLSTATE `45A01` (D-09 primary defense).
  2. A REVOKE migration stub ships at
     `priv/accrue/templates/migrations/revoke_accrue_events_writes.exs`
     for host apps to run as defense-in-depth (D-10).

The `Accrue.Events` module pattern-matches the underlying
`Postgrex.Error` on the `pg_code: "45A01"` field (NOT on message string
— D-11) and re-raises this exception so downstream callers see a clean
domain error type.

---

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