Possibility of different error types for different APIs

This commit is contained in:
Alex Auvolat
2022-05-13 13:51:34 +02:00
parent e4e1f8f0d6
commit 983037d965
7 changed files with 64 additions and 50 deletions
+2 -1
View File
@@ -2,6 +2,7 @@ use err_derive::Error;
use hyper::header::HeaderValue;
use hyper::{HeaderMap, StatusCode};
use garage_api::generic_server::ApiError;
use garage_util::error::Error as GarageError;
/// Errors of this crate
@@ -52,7 +53,7 @@ impl Error {
pub fn add_headers(&self, header_map: &mut HeaderMap<HeaderValue>) {
#[allow(clippy::single_match)]
match self {
Error::ApiError(e) => e.add_headers(header_map),
Error::ApiError(e) => e.add_http_headers(header_map),
_ => (),
}
}