aboutsummaryrefslogtreecommitdiff
path: root/src/util/error.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2020-04-24 17:46:52 +0000
committerAlex Auvolat <alex@adnab.me>2020-04-24 17:46:52 +0000
commitf2e05986c4d8cdf4abfde92e51e36f456e276ccd (patch)
tree174b2797468d47d6eb5ec6e3f4d0d768bb986151 /src/util/error.rs
parentd8f5e643bcee95969b59c309809710a38b0661e3 (diff)
downloadgarage-f2e05986c4d8cdf4abfde92e51e36f456e276ccd.tar.gz
garage-f2e05986c4d8cdf4abfde92e51e36f456e276ccd.zip
Starting to be S3 compatible
Diffstat (limited to 'src/util/error.rs')
-rw-r--r--src/util/error.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/util/error.rs b/src/util/error.rs
index f73d6915..cb99cbbc 100644
--- a/src/util/error.rs
+++ b/src/util/error.rs
@@ -69,6 +69,9 @@ pub enum Error {
#[error(display = "Bad request: {}", _0)]
BadRequest(String),
+ #[error(display = "Forbidden: {}", _0)]
+ Forbidden(String),
+
#[error(display = "Not found")]
NotFound,
@@ -84,6 +87,7 @@ impl Error {
match self {
Error::BadRequest(_) => StatusCode::BAD_REQUEST,
Error::NotFound => StatusCode::NOT_FOUND,
+ Error::Forbidden(_) => StatusCode::FORBIDDEN,
Error::RPC(_) => StatusCode::SERVICE_UNAVAILABLE,
_ => StatusCode::INTERNAL_SERVER_ERROR,
}