Expand description
Structured error envelope shared by core and the SDK.
This is the wire-level slice of the akribes-core::error module: the
ErrorKind / ErrorCode enums plus their pure-data impls
(as_wire, from_wire, kind, default_user_message,
suggested_action, is_transient, is_server_error,
is_user_actionable, base_backoff_ms), the ErrorSource /
ErrorDetail envelopes, the SuggestedAction tag, and the
ErrorCode::parse_retry_after_ms retry-after hint parser.
Functions that bring in heavier deps (regex-backed sanitize_error and
ErrorKind::classify, the tokio-backed CancelTracker / CancelReason,
the regex-backed ErrorCode::classify_provider_error) stay in
akribes_core::error so the types crate keeps its dependency surface
to serde, serde_json, thiserror, httpdate, and tracing.
Structs§
- Error
Detail - Structured failure detail attached to a
crate::value::Value::FatalErrorand to everyEngineEvent::Error. Replaces the previous(message, kind)shape with a richer envelope so SDKs can decide what to do, users get actionable text, and developers get structured fields for OTel/logs. - Error
Source - Where in the workflow an error originated. Every field is optional — fill what you know, leave the rest. SDKs render whichever fields are present; downstream tools (logs, OTel) read them as structured attributes for filtering/aggregation.
Enums§
- Error
Code - Stable, fine-grained error identifier. Each code maps to exactly one
ErrorKindand carries a default user-facing message. Wire form:AKRIBES-E-<UPPER-KEBAB>(e.g.AKRIBES-E-PROVIDER-RATE-LIMIT). - Error
Kind - Coarse error category. Use
ErrorCodefor the finer-grained, stable identifier that consumers should branch on;ErrorKindis the rollup every code belongs to (so a UI can show one bucket, an SDK can decide “is this retryable” without enumerating every code). - Suggested
Action - What the client/user/runner should do in response. Derived from
ErrorKind(seeErrorKind::suggested_action) so consumers don’t have to maintain their own switch statement.