aboutsummaryrefslogtreecommitdiff
path: root/src/web
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2021-10-15 11:05:09 +0200
committerAlex Auvolat <alex@adnab.me>2021-10-19 23:38:42 +0200
commit65070f3c05775f6692f4a16b6a304991d0510301 (patch)
treeaad55f988f3d29e3643e4141af6c53e79fd89257 /src/web
parente6da0dc90098a7c830e14f6f0dce61e8e7132d3a (diff)
downloadgarage-65070f3c05775f6692f4a16b6a304991d0510301.tar.gz
garage-65070f3c05775f6692f4a16b6a304991d0510301.zip
Improvements to CLI and various fixes for netapp version
Diffstat (limited to 'src/web')
-rw-r--r--src/web/Cargo.toml2
-rw-r--r--src/web/error.rs4
2 files changed, 4 insertions, 2 deletions
diff --git a/src/web/Cargo.toml b/src/web/Cargo.toml
index dc31c1b4..0b6620d2 100644
--- a/src/web/Cargo.toml
+++ b/src/web/Cargo.toml
@@ -26,4 +26,4 @@ percent-encoding = "2.1.0"
futures = "0.3"
http = "0.2"
-hyper = "0.14"
+hyper = { version = "0.14", features = ["server", "http1", "runtime", "tcp", "stream"] }
diff --git a/src/web/error.rs b/src/web/error.rs
index 08717ce1..5ac27914 100644
--- a/src/web/error.rs
+++ b/src/web/error.rs
@@ -38,7 +38,9 @@ impl Error {
match self {
Error::NotFound => StatusCode::NOT_FOUND,
Error::ApiError(e) => e.http_status_code(),
- Error::InternalError(GarageError::Rpc(_)) => StatusCode::SERVICE_UNAVAILABLE,
+ Error::InternalError(
+ GarageError::Timeout | GarageError::RemoteError(_) | GarageError::TooManyErrors(_),
+ ) => StatusCode::SERVICE_UNAVAILABLE,
Error::InternalError(_) => StatusCode::INTERNAL_SERVER_ERROR,
_ => StatusCode::BAD_REQUEST,
}