diff options
Diffstat (limited to 'src/routes/errors.rs')
| -rw-r--r-- | src/routes/errors.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/routes/errors.rs b/src/routes/errors.rs index 78b4e3a..f6a0901 100644 --- a/src/routes/errors.rs +++ b/src/routes/errors.rs @@ -7,6 +7,7 @@ pub enum RouteError { UserCreateUsernameExists(String), UnregisteredEmail(String), AuthorizationFailure(), + NotFound(String), } impl IntoResponse for RouteError { @@ -26,6 +27,9 @@ impl IntoResponse for RouteError { }, RouteError::AuthorizationFailure() => { (StatusCode::UNAUTHORIZED, format!("failed to authorize")) + }, + RouteError::NotFound(resource) => { + (StatusCode::NOT_FOUND, format!("{resource} not found")) } }; |
