Skip to main content

Module engine_error

Module engine_error 

Source
Expand description

Compatibility shim preserving the ff_sdk::engine_error surface.

RFC-012 Stage 1a: the EngineError enum and its sub-kinds moved to ff_core::engine_error; the From<ScriptError> + ScriptError-downcast helpers moved to ff_script::engine_error_ext. This module re-exports both so every ff_sdk::EngineError / ff_sdk::engine_error::* path used by existing consumers (cairn-fabric, the SDK’s own call sites) continues to compile unchanged.

The enrich_dependency_conflict helper is kept here (not moved) because it performs a live ferriskey::Client round trip; that dependency is ff-sdk–scoped.

Enums§

BugKind
FF-internal invariant-violation sub-kinds. Should not be reachable in a correctly-behaving deployment.
ConflictKind
Permanent conflict sub-kinds. Caller must reconcile rather than retry.
ContentionKind
Contention sub-kinds (retryable per RFC-010 §10.7). Caller should re-dispatch or re-read and retry.
EngineError
Typed engine-error surface. See module docs.
StateKind
Legal-but-surprising state sub-kinds. Per-variant semantics vary (some are benign no-ops, some are terminal). Consult the RFC-010 §10.7 classification table.
ValidationKind
Validation sub-kinds. 1:1 with the Lua validation codes.

Functions§

class
Classification of err using the ScriptError-aware table.
enrich_dependency_conflict
Upgrade a bare From<ScriptError> translation of dependency_already_exists into a fully-typed ConflictKind::DependencyAlreadyExists by performing the follow-up HGETALL on the edge hash.
transport_script
Construct a Valkey-backed Transport from a ScriptError. Preferred over struct-literal construction so the backend tag stays consistent across Valkey call sites.
transport_script_ref
If err is a Transport carrying a ScriptError, return a reference to the inner script error. Returns None for other variants and for Transport whose inner source is not a ScriptError (e.g. a Postgres-backed transport error).
valkey_kind
Returns the underlying ferriskey ErrorKind if err maps back to a transport-level fault whose inner source is a ScriptError. Postgres-backed or other non-Valkey transport errors return None.