The one exception. reason is the word that says why, and detail is the
sentence a reader needs, which is also the message.
A reason an answer carries is a reason an error carries, so an error that follows a denial names what the answer named. Three reasons belong to the library and not to a decider:
:unsupported, for what an adapter or a configuration cannot do:invalid, for a value at an edge that did not validate: a bulk write or an upsert on an audited schema, a raw call given a decision, a bad option, or a configuration that did not boot:unmediated, for a call that reached the seam with no decision and no exemption
Summary
Types
Why the call failed. An error never carries :allowed.
A failed call: why, and a detail that names what failed.
Functions
The error a denial makes. It names the reason the answer gave and who cannot do what. It adds the decider's own text where the answer carried one.
The error a value at an edge makes: what did not validate, and why it did not.
The reasons an error carries: a denial's reasons, and the library's own.
Types
@type reason() :: Mediate.Answer.reason() | :unsupported | :invalid | :unmediated
Why the call failed. An error never carries :allowed.
A failed call: why, and a detail that names what failed.
Functions
@spec denied( Mediate.subject(), atom(), Mediate.object() | atom(), reason(), String.t() | nil ) :: t()
The error a denial makes. It names the reason the answer gave and who cannot do what. It adds the decider's own text where the answer carried one.
The error a value at an edge makes: what did not validate, and why it did not.
@spec reasons() :: [reason()]
The reasons an error carries: a denial's reasons, and the library's own.