aboutsummaryrefslogtreecommitdiff
path: root/src/api/error.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2021-03-16 15:58:40 +0100
committerAlex Auvolat <alex@adnab.me>2021-03-16 15:58:40 +0100
commitf4346cc5f45839ace93d2d11ce6beea632fd8f2c (patch)
tree61d33a0c30faa972a81519c09dd94b34282658e5 /src/api/error.rs
parent2a41b8238496dfeac5ee0f273445299cbd112ff6 (diff)
downloadgarage-f4346cc5f45839ace93d2d11ce6beea632fd8f2c.tar.gz
garage-f4346cc5f45839ace93d2d11ce6beea632fd8f2c.zip
Update dependencies
Diffstat (limited to 'src/api/error.rs')
-rw-r--r--src/api/error.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/api/error.rs b/src/api/error.rs
index a1681fc3..42a7ab10 100644
--- a/src/api/error.rs
+++ b/src/api/error.rs
@@ -33,7 +33,7 @@ pub enum Error {
InvalidBase64(#[error(source)] base64::DecodeError),
#[error(display = "Invalid XML: {}", _0)]
- InvalidXML(#[error(source)] roxmltree::Error),
+ InvalidXML(String),
#[error(display = "Invalid header value: {}", _0)]
InvalidHeader(#[error(source)] hyper::header::ToStrError),
@@ -45,6 +45,12 @@ pub enum Error {
BadRequest(String),
}
+impl From<roxmltree::Error> for Error {
+ fn from(err: roxmltree::Error) -> Self {
+ Self::InvalidXML(format!("{}", err))
+ }
+}
+
impl Error {
pub fn http_status_code(&self) -> StatusCode {
match self {