summaryrefslogtreecommitdiff
path: root/src/routes/errors.rs
diff options
context:
space:
mode:
authorDaniel Hader <[email protected]>2026-06-05 19:29:40 -0500
committerDaniel Hader <[email protected]>2026-06-05 19:29:40 -0500
commitc071aca5c5c16d56aafe38ace2b2c158e1b875fc (patch)
treeaa947a0f6fa53be3de6fb879aa5c4d96bc087cf1 /src/routes/errors.rs
parent3ac68b8b59f150e08731a62026ce3ac825655614 (diff)
server text sanitation, username/email filters, and code length measurement
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}"))
}
};