aboutsummaryrefslogtreecommitdiff
path: root/src/util/error.rs
diff options
context:
space:
mode:
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,
}