diff options
Diffstat (limited to 'src/api/s3/error.rs')
-rw-r--r-- | src/api/s3/error.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/api/s3/error.rs b/src/api/s3/error.rs index 3cb97019..a0c4703c 100644 --- a/src/api/s3/error.rs +++ b/src/api/s3/error.rs @@ -11,6 +11,7 @@ use crate::common_error::CommonError; pub use crate::common_error::{OkOrBadRequest, OkOrInternalError}; use crate::generic_server::ApiError; use crate::s3::xml as s3_xml; +use crate::signature::error::Error as SignatureError; /// Errors of this crate #[derive(Debug, Error)] @@ -134,6 +135,18 @@ impl From<HelperError> for Error { } } +impl From<SignatureError> for Error { + fn from(err: SignatureError) -> Self { + match err { + SignatureError::CommonError(c) => Self::CommonError(c), + SignatureError::AuthorizationHeaderMalformed(c) => Self::AuthorizationHeaderMalformed(c), + SignatureError::Forbidden(f) => Self::Forbidden(f), + SignatureError::InvalidUtf8Str(i) => Self::InvalidUtf8Str(i), + SignatureError::InvalidHeader(h) => Self::InvalidHeader(h), + } + } +} + impl From<multer::Error> for Error { fn from(err: multer::Error) -> Self { Self::bad_request(err) |