pub enum SdkError {
Valkey(Error),
ValkeyContext {
source: Error,
context: String,
},
Engine(Box<EngineError>),
Config {
context: String,
field: Option<String>,
message: String,
},
WorkerAtCapacity,
Http {
source: Error,
context: String,
},
AdminApi {
status: u16,
message: String,
kind: Option<String>,
retryable: Option<bool>,
raw_body: String,
},
}Expand description
SDK error type.
Variants§
Valkey(Error)
Valkey connection or command error (preserves ErrorKind for caller inspection).
ValkeyContext
Valkey error with additional context.
Engine(Box<EngineError>)
FlowFabric engine error — typed sum over Lua error codes + transport
faults. See EngineError for the variant-granularity contract.
Replaces the previous Script(ScriptError) carrier (#58.6).
Boxed to keep SdkError’s stack footprint small: the richest
variant (ConflictKind::DependencyAlreadyExists { existing: EdgeSnapshot }) is ~200 bytes. Boxing keeps Result<T, SdkError>
at the same width every other variant pays.
Config
Configuration error. context identifies the call site / logical
operation (e.g. "describe_execution: exec_core", "admin_client").
field names the specific offending field when the error is
field-scoped (e.g. Some("public_state")), or None for
whole-object validation (e.g. "at least one lane is required").
message carries dynamic detail: source-error rendering, the
offending raw value, etc.
WorkerAtCapacity
Worker is at its configured max_concurrent_tasks capacity —
the caller should retry later. Returned by
FlowFabricWorker::claim_from_grant and
FlowFabricWorker::claim_from_reclaim_grant when the
concurrency semaphore is saturated. Distinct from Ok(None):
a ClaimGrant/ReclaimGrant represents real work already
selected by the scheduler, so silently dropping it would waste
the grant and let the grant TTL elapse. Surfacing the
saturation lets the caller release the grant (or wait +
retry).
§Classification
SdkError::is_retryablereturnstrue— saturation is transient: any in-flight task’s complete/fail/cancel/drop releases a permit. Retry after milliseconds, not a retry loop with backoff for a Valkey transport failure.SdkError::valkey_kindreturnsNone— this is not a Valkey transport or Lua error, so there is noferriskey::ErrorKindto inspect. Callers that fan out onvalkey_kind()should matchWorkerAtCapacityexplicitly (or useis_retryable()).
Http
HTTP transport error from the admin REST surface. Carries
the underlying reqwest::Error via #[source] so callers
can inspect is_timeout() / is_connect() / etc. for
finer-grained retry logic. Distinct from
SdkError::Valkey — this fires on the HTTP/JSON surface,
not on the Lua/Valkey hot path.
AdminApi
The admin REST endpoint returned a non-2xx response.
Fields surface the server-side ErrorBody JSON shape
({ error, kind?, retryable? }) as structured values so
cairn-fabric and other consumers can match without
re-parsing the body:
status— HTTP status code.message— theerrorstring from the JSON body (or the raw body if it didn’t parse as JSON).kind— server-supplied ValkeyErrorKindlabel for 5xxs backed by a transport error;Nonefor 4xxs.retryable— server-supplied hint;Nonefor 4xxs.raw_body— the full response body, preserved for logging when the JSON shape doesn’t match.
Implementations§
Source§impl SdkError
impl SdkError
Sourcepub fn valkey_kind(&self) -> Option<ErrorKind>
pub fn valkey_kind(&self) -> Option<ErrorKind>
Returns the underlying ferriskey ErrorKind if this error carries one.
Covers transport variants (Valkey, ValkeyContext) directly and
Engine(EngineError::Transport { .. }) via delegation.
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
Whether this error is safely retryable by a caller. For transport
variants, delegates to ff_script::retry::is_retryable_kind. For
Engine errors, returns true iff the typed classification is
ErrorClass::Retryable. Config errors are never retryable.
Trait Implementations§
Source§impl Error for SdkError
impl Error for SdkError
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()
Source§impl From<EngineError> for SdkError
impl From<EngineError> for SdkError
Source§fn from(err: EngineError) -> Self
fn from(err: EngineError) -> Self
Source§impl From<ScriptError> for SdkError
Preserves the ergonomic ?-propagation from FCALL sites that
return Result<_, ScriptError>. Routes through EngineError’s
typed classification so every call site gets the same
variant-level detail without hand-written conversion.
impl From<ScriptError> for SdkError
Preserves the ergonomic ?-propagation from FCALL sites that
return Result<_, ScriptError>. Routes through EngineError’s
typed classification so every call site gets the same
variant-level detail without hand-written conversion.
Source§fn from(err: ScriptError) -> Self
fn from(err: ScriptError) -> Self
Auto Trait Implementations§
impl Freeze for SdkError
impl !RefUnwindSafe for SdkError
impl Send for SdkError
impl Sync for SdkError
impl Unpin for SdkError
impl UnsafeUnpin for SdkError
impl !UnwindSafe for SdkError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.