pub enum StorageError {
NotFound {
key: String,
},
BucketNotFound {
bucket: String,
},
BackendUnavailable {
message: String,
},
Other {
source: Box<dyn Error + Send + Sync>,
},
NotModified,
PreconditionFailed,
RangeNotSatisfiable {
complete_length: u64,
},
}Expand description
Storage-layer error — distinct from Error so that different backends
(S3, in-memory mock, future prefix-per-KB) share a stable failure surface.
Variants§
NotFound
The requested object was not found in storage.
BucketNotFound
The storage bucket for the KB was not found.
The storage backend is temporarily unavailable.
Other
An unexpected storage error. The inner error provides details.
NotModified
S3 backend returned 304 Not Modified.
PreconditionFailed
S3 backend returned 412 Precondition Failed.
RangeNotSatisfiable
S3 backend returned 416 Range Not Satisfiable. complete_length is the total object size
extracted from the Content-Range: bytes */N header in the error response.
Implementations§
Source§impl StorageError
impl StorageError
Sourcepub fn is_not_found(&self) -> bool
pub fn is_not_found(&self) -> bool
Returns true if this error represents a missing object or bucket.
Trait Implementations§
Source§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
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<StorageError> for Error
impl From<StorageError> for Error
Source§fn from(err: StorageError) -> Self
fn from(err: StorageError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for StorageError
impl !UnwindSafe for StorageError
impl Freeze for StorageError
impl Send for StorageError
impl Sync for StorageError
impl Unpin for StorageError
impl UnsafeUnpin for StorageError
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
Mutably borrows from an owned value. Read more