A structured error returned (or raised, via the ! functions) for every
failure mode this library can produce: local validation failures, Triple
API error responses, and transport-level failures.
Fields
:type— one of:validation,:unauthenticated,:forbidden,:not_found,:rate_limited,:server_error,:unexpected_status, or:network_error.:message— a human-readable summary, suitable for logging.:status— the HTTP status code, ornilfor errors caught before any request was sent (e.g. local validation) or for network failures.:errors— for:validationerrors, a map offield => [messages](mirrors the shape of Triple's own400responses).:retry_after— for:rate_limitederrors, the number of seconds Triple asked you to wait, parsed from theretry-afterheader, if present. Note:Triple.Clientalready retries429s automatically (seeTriple.Config), so you'll typically only observe a:rate_limitederror after retries are exhausted.:raw_body— the raw decoded response body, for cases this module's summarization doesn't cover.
Because this is a proper Exception, every error can be raised directly
(raise error) and every context module exposes a ! variant that does
this for you (e.g. Triple.Enrich.transaction!/2).
Summary
Types
@type error_type() ::
:validation
| :unauthenticated
| :forbidden
| :not_found
| :rate_limited
| :server_error
| :unexpected_status
| :network_error
@type t() :: %Triple.Error{ __exception__: true, errors: %{optional(String.t()) => [String.t()]} | nil, message: String.t(), raw_body: term(), retry_after: non_neg_integer() | nil, status: pos_integer() | nil, type: error_type() }