Skip to main content

Module engine_error_ext

Module engine_error_ext 

Source
Expand description

ScriptError-aware extension helpers for ff_core::EngineError.

RFC-012 Stage 1a: the enum types live in ff-core so the EngineBackend trait can name them without ff-core depending on ff-script. The ScriptError-downcast logic cannot live in ff-core (naming ScriptError would require ff-core → ff-script, wrong direction). This module owns:

  • impl From<ScriptError> for EngineError — the full mapping.
  • transport_script / transport_script_ref — construct a Valkey-tagged Transport variant from a ScriptError and downcast the boxed source back to ScriptError respectively.
  • [valkey_kind] — inspect the inner ferriskey::ErrorKind when the Transport variant carries a ScriptError::Valkey.
  • class — upgrade ff-core’s default Terminal classification of Transport into the correct Phase-1 classification by delegating to ScriptError::class.

Functions§

class
Classification of err using the ScriptError-aware table.
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).