From fb18f5e17a34830d094fc591ee1d8accde2a85ad Mon Sep 17 00:00:00 2001 From: Quentin Date: Sat, 21 Nov 2020 18:14:02 +0100 Subject: Fix wrong http status code --- src/web/error.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/web/error.rs b/src/web/error.rs index 59810f0f..220bacfe 100644 --- a/src/web/error.rs +++ b/src/web/error.rs @@ -43,6 +43,7 @@ impl Error { pub fn http_status_code(&self) -> StatusCode { match self { Error::NotFound => StatusCode::NOT_FOUND, + Error::ApiError(e) => e.http_status_code(), Error::Forbidden(_) => StatusCode::FORBIDDEN, Error::InternalError(GarageError::RPC(_)) => StatusCode::SERVICE_UNAVAILABLE, Error::InternalError(_) | Error::Hyper(_) | Error::HTTP(_) => { -- cgit v1.2.3