pub enum CommonError {
InternalError(Error),
Hyper(Error),
Http(Error),
Forbidden(String),
BadRequest(String),
InvalidHeader(ToStrError),
NoSuchBucket(String),
BucketAlreadyExists,
BucketNotEmpty,
InvalidBucketName(String),
}
Expand description
Errors of this crate
Variants§
InternalError(Error)
Error related to deeper parts of Garage
Hyper(Error)
Error related to Hyper
Http(Error)
Error related to HTTP
Forbidden(String)
Proper authentication was not provided
BadRequest(String)
Generic bad request response with custom message
InvalidHeader(ToStrError)
The client sent a header with invalid value
NoSuchBucket(String)
The bucket requested don’t exists
BucketAlreadyExists
Tried to create a bucket that already exist
BucketNotEmpty
Tried to delete a non-empty bucket
InvalidBucketName(String)
Bucket name is not valid according to AWS S3 specs
Implementations§
Source§impl CommonError
impl CommonError
pub fn http_status_code(&self) -> StatusCode
pub fn aws_code(&self) -> &'static str
pub fn bad_request<M: ToString>(msg: M) -> Self
Trait Implementations§
Source§impl Debug for CommonError
impl Debug for CommonError
Source§impl Display for CommonError
impl Display for CommonError
Source§impl Error for CommonError
impl Error for CommonError
Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§fn cause(&self) -> Option<&dyn Error>
fn cause(&self) -> Option<&dyn Error>
👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
Source§impl From<Error> for CommonError
impl From<Error> for CommonError
Source§fn from(from: GarageError) -> Self
fn from(from: GarageError) -> Self
Converts to this type from the input type.
Source§impl From<Error> for CommonError
impl From<Error> for CommonError
Source§impl From<Error> for CommonError
impl From<Error> for CommonError
Source§impl From<Error> for CommonError
impl From<Error> for CommonError
Source§fn from(err: HelperError) -> Self
fn from(err: HelperError) -> Self
Converts to this type from the input type.
Source§impl From<ToStrError> for CommonError
impl From<ToStrError> for CommonError
Source§fn from(from: ToStrError) -> Self
fn from(from: ToStrError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for CommonError
impl !RefUnwindSafe for CommonError
impl Send for CommonError
impl Sync for CommonError
impl Unpin for CommonError
impl !UnwindSafe for CommonError
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
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>
Converts
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>
Converts
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