pub enum StorageError {
NotFound,
AccessDenied,
QuotaExceeded,
Backend(String),
}Expand description
Errors a storage backend can return.
Kept as a flat enum so the shape is stable across backends. Callers branch on the variant to map to HTTP status codes (e.g. 404 / 403 / 413 / 500) without having to parse a message string.
Variants§
NotFound
Key not found. Maps to HTTP 404 in the usual caller pattern.
Returned by get, delete, and presigned_url for non-existent
keys; list_page returns an empty page instead of NotFound.
AccessDenied
Authentication / authorization failure. Maps to HTTP 403. Covers both “wrong credentials” and “credentials valid but not allowed to touch this key”.
QuotaExceeded
Backend rejected the operation because a quota (object size, request rate, per-bucket ceiling) was exceeded. Maps to HTTP 413 when the caller is surfacing this to a user — an upload that was too big.
Backend(String)
Transport / storage layer failure (network, disk, provider 5xx, malformed response, SDK error). Maps to HTTP 500. The wrapped message is for logs, not for users.
Trait Implementations§
Source§impl Clone for StorageError
impl Clone for StorageError
Source§fn clone(&self) -> StorageError
fn clone(&self) -> StorageError
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for StorageError
impl Debug for StorageError
Source§impl Display for StorageError
impl Display for StorageError
Source§impl Error for StorageError
impl Error for StorageError
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()