aboutsummaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2020-05-01 15:52:35 +0000
committerAlex Auvolat <alex@adnab.me>2020-05-01 15:52:35 +0000
commitd867bbcfb513761c6709347509b8438cfdf408c7 (patch)
tree2eda9af740d620eb4b731012e1dda2e4040a895d /src/util
parent33249717010b1173fc28ba188e5fe6d580fbf393 (diff)
downloadgarage-d867bbcfb513761c6709347509b8438cfdf408c7.tar.gz
garage-d867bbcfb513761c6709347509b8438cfdf408c7.zip
Implement DeleteObjects
Diffstat (limited to 'src/util')
-rw-r--r--src/util/Cargo.toml1
-rw-r--r--src/util/error.rs12
2 files changed, 13 insertions, 0 deletions
diff --git a/src/util/Cargo.toml b/src/util/Cargo.toml
index 6f61a586..d8c39c62 100644
--- a/src/util/Cargo.toml
+++ b/src/util/Cargo.toml
@@ -32,4 +32,5 @@ hyper = "0.13"
rustls = "0.17"
webpki = "0.21"
+roxmltree = "0.11"
diff --git a/src/util/error.rs b/src/util/error.rs
index cb99cbbc..d2ed1ccf 100644
--- a/src/util/error.rs
+++ b/src/util/error.rs
@@ -114,3 +114,15 @@ impl<T> From<tokio::sync::mpsc::error::SendError<T>> for Error {
Error::Message(format!("MPSC send error"))
}
}
+
+impl From<std::str::Utf8Error> for Error {
+ fn from(e: std::str::Utf8Error) -> Error {
+ Error::BadRequest(format!("Invalid UTF-8: {}", e))
+ }
+}
+
+impl From<roxmltree::Error> for Error {
+ fn from(e: roxmltree::Error) -> Error {
+ Error::BadRequest(format!("Invalid XML: {}", e))
+ }
+}