diff options
author | Quentin <quentin@deuxfleurs.fr> | 2020-11-11 12:09:53 +0100 |
---|---|---|
committer | Quentin <quentin@deuxfleurs.fr> | 2020-11-11 12:09:53 +0100 |
commit | 8b0052d04f541d194818b2ad8994e00aba6b6781 (patch) | |
tree | 91e94efa9b5674ee9aa7fa53cd3f3415b457b8c3 /src/api/helpers.rs | |
parent | e31aa0f7dfb4c8f014ce65cdf749141d2a9fec21 (diff) | |
download | garage-feature/refactor-s3.tar.gz garage-feature/refactor-s3.zip |
Integrate with new error schemefeature/refactor-s3
Diffstat (limited to 'src/api/helpers.rs')
-rw-r--r-- | src/api/helpers.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/api/helpers.rs b/src/api/helpers.rs index f4d91788..b762bd3f 100644 --- a/src/api/helpers.rs +++ b/src/api/helpers.rs @@ -1,20 +1,20 @@ +use hyper::{Body, Response}; use std::convert::Infallible; use std::net::SocketAddr; -use hyper::{Body, Response}; -use garage_util::error::Error as GarageError; +use crate::error::*; pub trait InfallibleResult { fn make_infallible(self) -> Result<Response<Body>, Infallible>; } -impl InfallibleResult for Result<Response<Body>, GarageError> { +impl InfallibleResult for Result<Response<Body>, Error> { fn make_infallible(self) -> Result<Response<Body>, Infallible> { match self { Ok(x) => { - debug!("{} {:?}", x.status(), x.headers()); + debug!("{} {:?}", x.status(), x.headers()); Ok(x) - }, + } Err(e) => { let body: Body = Body::from(format!("{}\n", e)); let mut http_error = Response::new(body); |