Skip to main content

backend_context

Function backend_context 

Source
pub fn backend_context(
    err: EngineError,
    context: impl Into<String>,
) -> EngineError
Expand description

Wrap an EngineError with a call-site label when the error is a transport-family fault — Transport or Unavailable. Typed classifications (NotFound, Validation, Contention, Conflict, State, Bug) form the public contract boundary for consumers that match on the variant, so we return them unchanged. Repeated wraps on an already-Contextual error nest an additional layer; callers should wrap once per op boundary.

Promoted to ff-core so ff-backend-valkey can annotate its EngineBackend impls with the same context shape ff-sdk’s snapshot helpers use (issue #154).