From d867bbcfb513761c6709347509b8438cfdf408c7 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Fri, 1 May 2020 15:52:35 +0000 Subject: Implement DeleteObjects --- src/util/Cargo.toml | 1 + src/util/error.rs | 12 ++++++++++++ 2 files changed, 13 insertions(+) (limited to 'src/util') 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 From> for Error { Error::Message(format!("MPSC send error")) } } + +impl From for Error { + fn from(e: std::str::Utf8Error) -> Error { + Error::BadRequest(format!("Invalid UTF-8: {}", e)) + } +} + +impl From for Error { + fn from(e: roxmltree::Error) -> Error { + Error::BadRequest(format!("Invalid XML: {}", e)) + } +} -- cgit v1.2.3