Reference

Error taxonomy

The 18 public exception types and the fields on ProjectionError.

Stable is the type. Message text is not a contract. Read ProjectionError.role / .where / .recipe instead of parsing the string.

Catch the owner, not the whole tree

The exception family tells the next responsible boundary what to do. Keep the typed error visible until the application can choose a code fix, a retry, a repair, or an operator response.

ap.AgentspartyError
├── ap.ProtocolError
│   ├── ap.ProjectionError        (.role, .where, .recipe)
│   ├── ap.ConformanceError
│   ├── ap.CompositionError
│   └── ap.ProtocolMismatch
├── ap.SessionError
│   ├── ap.AllowanceExceeded      (.limit, .spent)
│   ├── ap.SelectionError
│   ├── ap.DeadlineExceeded
│   ├── ap.JournalError
│   └── ap.Cancelled
├── ap.ContentError
│   ├── ap.DecodeError
│   └── ap.RefinementError
└── ap.ModelError
    ├── ap.ModelUnavailable
    └── ap.ModelRefused
ErrorStable contract
AgentspartyErrorBase class for expected library boundary failures.
ProtocolErrorThe declared topology cannot be built or analysed.
ProjectionErrorA role cannot observe or perform its projected duties.
ConformanceErrorA participant does not conform to its endpoint.
CompositionErrorProtocol fragments cannot be composed safely.
ProtocolMismatchA journal belongs to another protocol shape.
SessionErrorA running session cannot continue.
AllowanceExceededA run exceeded one named resource limit.
SelectionErrorA participant selected a message outside its offer.
DeadlineExceededA declared time window expired before the step completed.
JournalErrorRecorded decisions cannot be read or validated.
CancelledA participant received a session cancellation.
ContentErrorA message value is invalid at the content boundary.
DecodeErrorA response cannot be decoded into the offered message.
RefinementErrorA decoded value fails a declared refinement.
ModelErrorA model boundary failed to produce an answer.
ModelUnavailableThe provider or transport is unavailable.
ModelRefusedThe provider refused the requested content.
import agentsparty as ap

tree = [
    ap.AgentspartyError,
    ap.ProtocolError,
    ap.ProjectionError,
    ap.ConformanceError,
    ap.CompositionError,
    ap.ProtocolMismatch,
    ap.SessionError,
    ap.AllowanceExceeded,
    ap.SelectionError,
    ap.DeadlineExceeded,
    ap.JournalError,
    ap.Cancelled,
    ap.ContentError,
    ap.DecodeError,
    ap.RefinementError,
    ap.ModelError,
    ap.ModelUnavailable,
    ap.ModelRefused,
]

ProtocolError covers malformed topology, projection, composition, and journal identity; SessionError covers runtime selection, budgets, cancellation, and deadlines. ContentError covers a payload that does not decode or satisfy a refinement. ModelError covers provider availability and refusal. A broken programmer contract is an assertion, not one of these expected boundary failures.

Handling strategy

Handle errors at the boundary that owns the next action:

Error familyRecovery belongs toTypical response
ProtocolErrordeveloper or deploymentfix the protocol, cast, or journal identity before accepting work
SessionErrorapplication runtimereport a stopped run, ask for a human choice, or return a partial transcript
ContentErrorparticipant boundaryrepair a bounded decode failure or reject the input
ModelErrorprovider policyretry when allowed, choose fallback, or surface the outage/refusal

Do not catch AgentspartyError at the top and turn every failure into “agent failed”. That loses whether the next action is a code change, a client retry, an operator decision, or a provider configuration fix. The exception type is the stable part of this API; message text is for diagnostics.

Stable

On this page