#[non_exhaustive]pub enum EngineError {
NotFound {
entity: &'static str,
},
Validation {
kind: ValidationKind,
detail: String,
},
Contention(ContentionKind),
Conflict(ConflictKind),
State(StateKind),
Bug(BugKind),
Transport {
backend: &'static str,
source: Box<dyn Error + Send + Sync>,
},
Unavailable {
op: &'static str,
},
Contextual {
source: Box<EngineError>,
context: String,
},
}Expand description
Typed engine-error surface. See module docs.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
NotFound
A uniquely-identified resource did not exist. entity is a
stable label (e.g. "execution", "flow", "attempt") that
consumers can match without re-parsing a message.
Validation
Caller supplied a malformed, out-of-range, or otherwise
rejected input. detail carries the Lua-side payload (field
name, offending value, or CSV of missing tokens, depending on
kind).
Contention(ContentionKind)
Transient conflict with another worker or with the current state of the execution/flow. Caller should retry per RFC-010 §10.7.
Conflict(ConflictKind)
Permanent conflict — the requested mutation conflicts with an existing record (e.g. duplicate edge, cycle, already-in-flow). Caller must not blindly retry.
State(StateKind)
Legal but surprising state — lease expired, already-suspended,
duplicate-signal, budget-exceeded, etc. Per-variant semantics
documented on StateKind.
Bug(BugKind)
FF-internal invariant violation that should not be reachable in a correctly-behaving deployment. Consumers typically log and surface as a 5xx.
Transport
Backend transport fault or response-parse failure (RFC-012 §4.2
round-4 shape). Broadened in Stage 0 to carry Box<dyn Error>
so non-Valkey backends (Postgres, future) can route their
native transport errors through this variant without going via
ScriptError.
backend— static diagnostic label ("valkey","postgres", etc.). Kept&'static strto avoid heap alloc on construction.source— boxed error. For the Valkey backend this isff_script::error::ScriptError; downcast withsource.downcast_ref::<ScriptError>()to recoverferriskey::ErrorKind/ parse detail. Helper lives inff_script::engine_error_ext::transport_script_ref.
Backend method not wired up yet (RFC-012 §4.2 K#7 holdover).
Returned by staged backend impls for methods that are known
types in the trait but not yet implemented. Graceful degradation
in place of unimplemented!() panics. Additive; does not
participate in the From<ScriptError> mapping.
Contextual
An inner EngineError wrapped with a call-site label so
operators triaging logs can see which op the error came from
without inferring from surrounding spans. Constructed via
backend_context; carries a lightweight string context
(e.g. "renew: FCALL ff_renew_lease").
Classification helpers (ErrorClass, BackendErrorKind,
etc.) transparently descend into source so a consumer that
matches on the wrapper arm keeps the same retry/terminal
semantics as the unwrapped inner error.
Implementations§
Source§impl EngineError
impl EngineError
Sourcepub fn class(&self) -> ErrorClass
pub fn class(&self) -> ErrorClass
Classify an EngineError using the underlying
ErrorClass table.
Transport classification in ff-core: the inner source is
Box<dyn std::error::Error> which ff-core cannot downcast
without naming ScriptError. ff-core returns Terminal for
every Transport variant by default. Callers needing the
Retryable-on-transient-Valkey-error classification use
ff_script::engine_error_ext::class which downcasts to
ScriptError and delegates to ScriptError::class. ff-sdk’s
public SdkError::is_retryable / backend_kind methods wire
the ff-script helper in so consumers retain the Phase-1
behavior transparently. (backend_kind was renamed from
valkey_kind in #88.)
Trait Implementations§
Source§impl Debug for EngineError
impl Debug for EngineError
Source§impl Display for EngineError
impl Display for EngineError
Source§impl Error for EngineError
impl Error for EngineError
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 EngineError
impl From<ScriptError> for EngineError
Source§fn from(err: ScriptError) -> EngineError
fn from(err: ScriptError) -> EngineError
Auto Trait Implementations§
impl Freeze for EngineError
impl !RefUnwindSafe for EngineError
impl Send for EngineError
impl Sync for EngineError
impl Unpin for EngineError
impl UnsafeUnpin for EngineError
impl !UnwindSafe for EngineError
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.