#[non_exhaustive]pub enum BackendError {
Valkey {
kind: BackendErrorKind,
message: String,
},
RequiresDevMode,
}Expand description
Backend-agnostic transport error carried across public ff-sdk / ff-server error surfaces (#88).
The Valkey variant is the only one populated today; additional
variants (e.g. Postgres) will be added additively as other
backends land. The enum is #[non_exhaustive] so consumers must
include a wildcard arm.
Construction from the Valkey-native ferriskey::Error lives in
ff_backend_valkey::backend_error_from_ferriskey — keeping that
conversion outside ff-core preserves ff-core’s ferriskey-free
public surface.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Valkey
Valkey-backend transport failure. Carries a backend-agnostic classification plus the backend-rendered message so downstream consumers can inspect without depending on ferriskey.
RequiresDevMode
RFC-023 §4.5: the SQLite dev-only backend refused to construct
because FF_DEV_MODE=1 was not set. Exact message text mirrors
§3.3 HTTP-path text so embedded and server paths give the same
actionable signal.
Implementations§
Source§impl BackendError
impl BackendError
Sourcepub fn kind(&self) -> BackendErrorKind
pub fn kind(&self) -> BackendErrorKind
Returns the classified backend kind.
Every variant maps to a BackendErrorKind — transport
variants return their carried kind, configuration/guard
variants return the closest-fitting classification (e.g.
BackendError::RequiresDevMode → BackendErrorKind::Protocol
because it is a configuration refusal, not a retryable
transport fault). Consumers needing to distinguish the
underlying variant should match directly on BackendError;
kind() is the stable, classifier-only view.
Trait Implementations§
Source§impl Clone for BackendError
impl Clone for BackendError
Source§fn clone(&self) -> BackendError
fn clone(&self) -> BackendError
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for BackendError
impl Debug for BackendError
Source§impl Display for BackendError
impl Display for BackendError
Source§impl Error for BackendError
impl Error for BackendError
1.30.0 · 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()