aboutsummaryrefslogtreecommitdiff
path: root/src/web
diff options
context:
space:
mode:
authorQuentin <quentin@deuxfleurs.fr>2020-11-21 18:14:02 +0100
committerQuentin <quentin@deuxfleurs.fr>2020-11-21 18:14:02 +0100
commitfb18f5e17a34830d094fc591ee1d8accde2a85ad (patch)
tree68b9e14b0f158ef3625e79a00698d9a33ff01a03 /src/web
parent28efe341cbb4d96b5f81f5fe756f1a0995461e77 (diff)
downloadgarage-fb18f5e17a34830d094fc591ee1d8accde2a85ad.tar.gz
garage-fb18f5e17a34830d094fc591ee1d8accde2a85ad.zip
Fix wrong http status code
Diffstat (limited to 'src/web')
-rw-r--r--src/web/error.rs1
1 files changed, 1 insertions, 0 deletions
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(_) => {