summaryrefslogtreecommitdiff
path: root/src/routes/errors.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/routes/errors.rs')
-rw-r--r--src/routes/errors.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/routes/errors.rs b/src/routes/errors.rs
index f6a0901..5161e9a 100644
--- a/src/routes/errors.rs
+++ b/src/routes/errors.rs
@@ -3,6 +3,7 @@ use serde_json::{json};
pub enum RouteError {
Internal(String),
+ MalformedField(String),
UserCreateEmailExists(String),
UserCreateUsernameExists(String),
UnregisteredEmail(String),
@@ -30,6 +31,9 @@ impl IntoResponse for RouteError {
},
RouteError::NotFound(resource) => {
(StatusCode::NOT_FOUND, format!("{resource} not found"))
+ },
+ RouteError::MalformedField(field) => {
+ (StatusCode::BAD_REQUEST, format!("malformed {field}"))
}
};