Raised when the mailglass_events append-only immutability trigger fires.
The event ledger is append-only by design (D-15 project-level, D-06 phase-level).
A Postgres BEFORE UPDATE OR DELETE trigger on mailglass_events raises
SQLSTATE 45A01 for every mutation attempt. Mailglass.Repo.transact/1
translates that %Postgrex.Error{} into this struct so callers pattern-match
a mailglass-owned error, never the raw Postgrex one.
Types
:update_attempt— an UPDATE statement hit the trigger:delete_attempt— a DELETE statement hit the trigger
Never retryable — an immutability violation is a bug in the calling code.
See Mailglass.Error for the shared contract and docs/api_stability.md
for the locked :type atom set.
Summary
Functions
Returns the closed set of valid :type atoms. Tested against docs/api_stability.md.
Build a Mailglass.EventLedgerImmutableError struct.
Types
@type t() :: %Mailglass.EventLedgerImmutableError{ __exception__: true, cause: Exception.t() | nil, context: %{required(atom()) => term()}, message: String.t(), pg_code: String.t(), type: :update_attempt | :delete_attempt }
Functions
@spec __types__() :: [atom()]
Returns the closed set of valid :type atoms. Tested against docs/api_stability.md.
Build a Mailglass.EventLedgerImmutableError struct.
Options
:cause— the underlying%Postgrex.Error{}(kept out of JSON output).:context— a map of non-PII metadata.:pg_codeis propagated into the:pg_codestruct field.:pg_code— the SQLSTATE code; defaults to"45A01".