pub enum BackendError {
BucketNotFound {
kind: BackendKind,
name: String,
},
NotAuthorized {
kind: BackendKind,
action: String,
name: String,
},
Network {
source: BoxError,
},
InvalidCredentials {
source: ObjectStoreError,
},
UnknownStoredEngine {
kind: BackendKind,
stored: String,
},
EngineMismatch {
kind: BackendKind,
url_engine: StorageEngine,
stored_engine: StorageEngine,
},
}Expand description
Errors surfaced by build.
The Display strings (no colons, “user” prefix on NotAuthorized)
are the single source of truth for the operator-facing wording
rendered by fatal_message.
§Invariant for backend-specific wording
Every variant whose Display string mentions the storage container
(“bucket” / “container”) must carry a kind: BackendKind field and
route the noun through [container_word]. Hardcoded “bucket” /
“container” literals in the format string are a bug — they leak S3
vocabulary into Azure diagnostics (and vice versa). New variants
must follow the same pattern as BackendError::BucketNotFound.
§Invariant for fatal_message
fatal_message walks the error source chain starting one level
past err.source(), because any variant with a #[source] field
already embeds {source} in its Display format string (making
the first level visible without chain-walking). Every future
variant that adds a #[source] field must also include {source}
in its format string. Omitting {source} while keeping
#[source] causes fatal_message to silently drop the first
source level from the rendered message.
§Invariant for Network classification
When [classify] or validate_format encounter
ObjectStoreError::Network, they extract the inner BoxError
and store it directly in BackendError::Network::source. They
must never wrap the whole ObjectStoreError::Network (whose
own Display is "network error: <inner>") into another
BackendError variant whose Display also includes the source —
that produces the redundant "network error: network error: ..."
rendering fatal_message is documented to avoid. New
ObjectStoreError variants that carry transport semantics must
either add a dedicated BackendError::Network-style classification
arm or store the inner cause directly.
Variants§
BucketNotFound
Bucket (S3) or container (Azure) does not exist. Maps from a
404 / NoSuchBucket on the construction-time probe.
NotAuthorized
Authentication succeeded but the principal lacks the listed
action on the named bucket/container. Maps from a 403 /
AccessDenied on the probe.
Fields
kind: BackendKindWhich backend reported the failure.
Network
Transport-level failure during backend construction (probe or FORMAT
key read): DNS resolution failed, connection refused, TLS handshake
error, or request timeout. This indicates a URL or network
configuration problem — not a credentials problem. The inner error is
extracted from ObjectStoreError::Network and stored directly to
avoid the redundant “network error: network error” display that would
result from wrapping it whole.
InvalidCredentials
Catch-all for credential acquisition failures (missing AWS profile, expired creds, missing Azure credential alias, …).
Fields
source: ObjectStoreErrorThe underlying ObjectStoreError preserved as #[source].
UnknownStoredEngine
The FORMAT key records an engine name this binary does not support.
The supported-engine list is rendered from
StorageEngine::supported_list_str so adding a new variant
updates this message automatically.
Fields
kind: BackendKindWhich backend reported the failure.
EngineMismatch
The ?engine= URL parameter conflicts with the engine stored in the
FORMAT key.
Fields
kind: BackendKindWhich backend reported the failure.
url_engine: StorageEngineEngine requested via the ?engine= URL parameter.
stored_engine: StorageEngineEngine stored in the FORMAT key.
Trait Implementations§
Source§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
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 ProtocolError
impl From<BackendError> for ProtocolError
Source§fn from(source: BackendError) -> Self
fn from(source: BackendError) -> Self
Source§impl From<BackendError> for RemoteError
impl From<BackendError> for RemoteError
Source§fn from(source: BackendError) -> Self
fn from(source: BackendError) -> Self
Auto Trait Implementations§
impl !RefUnwindSafe for BackendError
impl !UnwindSafe for BackendError
impl Freeze for BackendError
impl Send for BackendError
impl Sync for BackendError
impl Unpin for BackendError
impl UnsafeUnpin for BackendError
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> ErrorExt for T
impl<T> ErrorExt for 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 moreSource§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.