pub enum AkribesError {
Fatal {
message: String,
execution_id: Option<String>,
},
Transient {
message: String,
execution_id: Option<String>,
retry_after: Option<Duration>,
status: Option<u16>,
},
Script {
message: String,
execution_id: Option<String>,
},
Timeout {
execution_id: Option<String>,
},
Http(Error),
Json(Error),
ScriptSchemaChanged {
script_name: String,
},
ScriptInputMismatch {
script_name: String,
missing: Vec<String>,
extra: Vec<String>,
},
MissingProjectId,
HttpStatus {
status: u16,
message: String,
},
AlreadyExists {
message: String,
existing_id: i64,
},
Other(String),
}Expand description
Error types for the Akribes SDK.
Variants§
Fatal
Auth or permission failure (401/403) — retrying will not help.
Transient
Rate-limit or server unavailability (429/500/502/503/504) — safe
to retry. retry_after carries the Retry-After header when the
server sent one as numeric seconds (HTTP-date form ignored,
matching Python). status carries the HTTP status code so callers
can branch on the specific upstream signal after #1296 split the
5xx variants by retry semantics (500/502 short, 503 rate-limit-adjacent,
504 long). None when the underlying failure has no HTTP status
(e.g. polling timeout, SSE disconnect).
Fields
retry_after: Option<Duration>Parsed Retry-After header in seconds (#1009). None when the
server omitted the header or sent HTTP-date form.
status: Option<u16>HTTP status code that produced this error. None for non-HTTP
transients (e.g. SSE disconnect, polling deadline). Use
Self::recommended_backoff_ms to pick the per-status base
backoff (#1296).
Script
The Akribes script itself failed or was cancelled.
Timeout
Polling for an execution result exceeded the caller-supplied timeout.
Http(Error)
Underlying HTTP transport error.
Json(Error)
JSON (de)serialisation error.
ScriptSchemaChanged
Script schema changed since init() — re-register to continue.
ScriptInputMismatch
Document keys don’t match the cached script input schema.
MissingProjectId
A project-scoped operation was called on a client built without
project_id. Use AkribesClient::new(...) or set .project_id(...)
on the builder.
HttpStatus
HTTP error with a non-success status code.
AlreadyExists
HTTP 409 with error_type=suite_already_exists. Carries the
existing row id so callers can redirect the operator.
Other(String)
Any other client-side error.
Implementations§
Source§impl AkribesError
impl AkribesError
Sourcepub fn parse_input_validation_errors(&self) -> Option<Vec<InputValidationEntry>>
pub fn parse_input_validation_errors(&self) -> Option<Vec<InputValidationEntry>>
Method form of parse_input_validation_errors.
Sourcepub fn recommended_backoff_ms(status: u16) -> Option<u64>
pub fn recommended_backoff_ms(status: u16) -> Option<u64>
Recommended base backoff (in milliseconds) for a transient HTTP
status (#1296). Mirrors ErrorKind::base_backoff_ms on the core
side and recommendedBackoffMs in the TS SDK, so retry cadences
agree across the stack:
| Status | Base (ms) | Rationale |
|---|---|---|
| 429 | 2000 | Rate-limit; honour Retry-After |
| 500 | 1000 | Maybe-transient origin error |
| 502 | 1000 | Edge fronted failing origin |
| 503 | 2000 | Rate-limit-adjacent capacity issue |
| 504 | 4000 | Slow upstream — longer base |
Returns None for any status the SDK doesn’t classify as
retriable (or for non-HTTP transients).
Sourcepub fn transient_status(&self) -> Option<u16>
pub fn transient_status(&self) -> Option<u16>
Return the HTTP status if this error is a transient with a known
status code (#1296). Returns None for non-Transient variants or
for transients without a status (e.g. SSE disconnect, polling
timeout).
Trait Implementations§
Source§impl Debug for AkribesError
impl Debug for AkribesError
Source§impl Display for AkribesError
impl Display for AkribesError
Source§impl Error for AkribesError
impl Error for AkribesError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()