pub enum Error {
VaultNotFound,
InvalidFileName,
FileAlreadyExists(String),
CreateTempFile {
path: PathBuf,
source: Error,
},
WriteChunkFailure {
path: PathBuf,
source: Error,
},
StreamReadError(Error),
RenameError {
path: PathBuf,
source: Error,
},
InvalidPath {
path: PathBuf,
},
Internal(Error),
NotFound,
}Expand description
Errors that can occur in the storage layer.
These are filesystem and transaction-level failures. Most are internal
and should never be exposed to the client in detail. The IntoResponse
implementation handles sanitization automatically.
Variants§
VaultNotFound
The vault directory does not exist on disk.
This is a fatal misconfiguration and means the server was started
with an invalid vault_path.
InvalidFileName
The provided filename contained illegal characters (/, \, or was empty).
This protects against path traversal attacks.
FileAlreadyExists(String)
A file with this name already exists at the target path. This is returned when a duplicate upload is attempted for the exact same filename.
CreateTempFile
The server failed to create the temporary staging file before streaming begins.
WriteChunkFailure
A write to disk failed mid-stream while appending a chunk to the temporary file.
StreamReadError(Error)
Reading the next chunk from the incoming network stream failed.
RenameError
The atomic rename from the temporary staging file to the final CAS path failed.
InvalidPath
The constructed path pointed outside the vault directory.
Internal(Error)
A low-level internal error, typically from integer or time conversions.
NotFound
The requested blob was not found in the vault.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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<SystemTimeError> for Error
impl From<SystemTimeError> for Error
Source§fn from(e: SystemTimeError) -> Self
fn from(e: SystemTimeError) -> Self
Source§impl From<TryFromIntError> for Error
impl From<TryFromIntError> for Error
Source§fn from(e: TryFromIntError) -> Self
fn from(e: TryFromIntError) -> Self
Auto Trait Implementations§
impl !RefUnwindSafe for Error
impl !UnwindSafe for Error
impl Freeze for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
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> Color for Twhere
T: Display,
impl<T> Color for Twhere
T: Display,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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