pub enum ServerError {
Show 13 variants
Backend(BackendError),
BackendContext {
source: BackendError,
context: String,
},
Config(ConfigError),
LibraryLoad(LoadError),
PartitionMismatch(String),
NotFound(String),
InvalidInput(String),
OperationFailed(String),
Script(String),
ConcurrencyLimitExceeded(&'static str, u32),
ValkeyVersionTooLow {
detected: String,
required: String,
},
BackendNotReady {
backend: &'static str,
stage: &'static str,
},
Engine(Box<EngineError>),
}Expand description
Server error type.
Variants§
Backend(BackendError)
Backend transport error. Previously wrapped ferriskey::Error
directly (#88); now carries a backend-agnostic
ff_core::BackendError so consumers match on
ff_core::BackendErrorKind instead of ferriskey’s native
taxonomy. The ferriskey → ff_core::BackendError mapping
lives in ff_backend_valkey::backend_error_from_ferriskey.
BackendContext
Backend error with additional context. Previously
ValkeyContext { source: ferriskey::Error } (#88).
Config(ConfigError)
LibraryLoad(LoadError)
PartitionMismatch(String)
NotFound(String)
InvalidInput(String)
OperationFailed(String)
Script(String)
ConcurrencyLimitExceeded(&'static str, u32)
Server-wide concurrency limit reached on a labelled pool. Surfaces
as HTTP 429 at the REST boundary so load balancers and clients can
retry with backoff. The source label (“stream_ops”, “admin_rotate”,
etc.) identifies WHICH pool is exhausted so operators aren’t
misled by a single “tail unavailable” string when the real fault
is rotation contention.
Fields: (source_label, max_permits).
ValkeyVersionTooLow
Detected Valkey version is below the RFC-011 §13 minimum. The engine depends on Valkey Functions (stabilized in 7.2), RESP3 (7.2+), and hash-tag routing; older versions do not implement the required primitives. Operator action: upgrade Valkey.
BackendNotReady
RFC-017 §9.0 hard-gate: selected backend is not yet permitted
to boot in this ff-server binary. Operator action is to
either (a) select FF_BACKEND=valkey, or (b) upgrade to a
Stage E binary once v0.8.0 ships.
stage names the current stage (“A”/“B”/“C”/“D”) so operator
tooling can correlate the refusal with the migration plan.
Engine(Box<EngineError>)
RFC-017 Stage A: an EngineBackend trait method returned a
typed error that is not one of the specific business outcomes
existing ServerError variants model. Includes transport
faults, validation/corruption, and Unavailable for methods
the backend has not implemented yet.
Stage B/C migrations may refine individual arms into richer
ServerError variants as more handlers route through the
trait; Stage A keeps this catch-all so the migration lands
additively. Boxed to keep ServerError small (clippy
result_large_err — EngineError is ~200 bytes).
Implementations§
Source§impl ServerError
impl ServerError
Sourcepub fn backend_kind(&self) -> Option<BackendErrorKind>
pub fn backend_kind(&self) -> Option<BackendErrorKind>
Returns the classified ff_core::BackendErrorKind if this
error carries a backend transport fault. Covers direct
Backend variants and library-load failures.
Renamed from valkey_kind in #88 — the previous return type
Option<ferriskey::ErrorKind> leaked ferriskey into every
consumer doing retry/error classification.
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
Whether this error is safely retryable by a caller. For
backend transport variants, delegates to
ff_core::BackendErrorKind::is_retryable. Business-logic
rejections (NotFound, InvalidInput, OperationFailed, Script,
Config, PartitionMismatch) return false — those won’t change
on retry.
Trait Implementations§
Source§impl Debug for ServerError
impl Debug for ServerError
Source§impl Display for ServerError
impl Display for ServerError
Source§impl Error for ServerError
impl Error for ServerError
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<BackendError> for ServerError
impl From<BackendError> for ServerError
Source§fn from(source: BackendError) -> Self
fn from(source: BackendError) -> Self
Source§impl From<Box<EngineError>> for ServerError
impl From<Box<EngineError>> for ServerError
Source§fn from(source: Box<EngineError>) -> Self
fn from(source: Box<EngineError>) -> Self
Source§impl From<ConfigError> for ServerError
impl From<ConfigError> for ServerError
Source§fn from(source: ConfigError) -> Self
fn from(source: ConfigError) -> Self
Source§impl From<EngineError> for ServerError
Lift an unboxed EngineError into ServerError::Engine. The
variant stores a Box<EngineError> to keep ServerError small
(clippy result_large_err); this From restores ?-propagation
from trait-dispatched handler paths.
impl From<EngineError> for ServerError
Lift an unboxed EngineError into ServerError::Engine. The
variant stores a Box<EngineError> to keep ServerError small
(clippy result_large_err); this From restores ?-propagation
from trait-dispatched handler paths.
Source§fn from(err: EngineError) -> Self
fn from(err: EngineError) -> Self
Source§impl From<Error> for ServerError
Lift a native ferriskey::Error into ServerError::Backend via
ff_backend_valkey::backend_error_from_ferriskey (#88). Keeps
?-propagation ergonomic at ferriskey call sites while the
public variant stays backend-agnostic.
impl From<Error> for ServerError
Lift a native ferriskey::Error into ServerError::Backend via
ff_backend_valkey::backend_error_from_ferriskey (#88). Keeps
?-propagation ergonomic at ferriskey call sites while the
public variant stays backend-agnostic.
Auto Trait Implementations§
impl Freeze for ServerError
impl !RefUnwindSafe for ServerError
impl Send for ServerError
impl Sync for ServerError
impl Unpin for ServerError
impl UnsafeUnpin for ServerError
impl !UnwindSafe for ServerError
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 more