aboutsummaryrefslogtreecommitdiff
path: root/src/api/error.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/api/error.rs')
-rw-r--r--src/api/error.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/api/error.rs b/src/api/error.rs
index 4ad8ef82..9bb8f8e2 100644
--- a/src/api/error.rs
+++ b/src/api/error.rs
@@ -65,6 +65,10 @@ pub enum Error {
/// The client sent an invalid request
#[error(display = "Bad request: {}", _0)]
BadRequest(String),
+
+ /// The client sent a request for an action not supported by garage
+ #[error(display = "Unimplemented action: {}", _0)]
+ NotImplemented(String),
}
impl From<roxmltree::Error> for Error {
@@ -94,6 +98,7 @@ impl Error {
StatusCode::INTERNAL_SERVER_ERROR
}
Error::InvalidRange(_) => StatusCode::RANGE_NOT_SATISFIABLE,
+ Error::NotImplemented(_) => StatusCode::NOT_IMPLEMENTED,
_ => StatusCode::BAD_REQUEST,
}
}