garage_api_common/signature/
error.rs1use err_derive::Error;
2
3use crate::common_error::CommonError;
4pub use crate::common_error::{CommonErrorDerivative, OkOrBadRequest, OkOrInternalError};
5
6#[derive(Debug, Error)]
8pub enum Error {
9 #[error(display = "{}", _0)]
10 Common(CommonError),
12
13 #[error(display = "Authorization header malformed, unexpected scope: {}", _0)]
15 AuthorizationHeaderMalformed(String),
16
17 #[error(display = "Invalid UTF-8: {}", _0)]
20 InvalidUtf8Str(#[error(source)] std::str::Utf8Error),
21
22 #[error(display = "Invalid digest: {}", _0)]
24 InvalidDigest(String),
25}
26
27impl<T> From<T> for Error
28where
29 CommonError: From<T>,
30{
31 fn from(err: T) -> Self {
32 Error::Common(CommonError::from(err))
33 }
34}
35
36impl CommonErrorDerivative for Error {}