summaryrefslogtreecommitdiffstats
path: root/src/errors.rs
diff options
context:
space:
mode:
authorSanto Cariotti <santo@dcariotti.me>2022-09-03 10:09:52 +0000
committerSanto Cariotti <santo@dcariotti.me>2022-09-03 10:09:52 +0000
commit6cda1b704d1c38fc116e59a2a206c2adebfb6d4d (patch)
treec4e18bd2ba164f5205d5faa08bac60a33a92f891 /src/errors.rs
parent323822a100640fe85a61d3f806fc96fb62143a35 (diff)
`NotFound` error has now a string value
Diffstat (limited to 'src/errors.rs')
-rw-r--r--src/errors.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/errors.rs b/src/errors.rs
index 1ce4502..72eb837 100644
--- a/src/errors.rs
+++ b/src/errors.rs
@@ -12,7 +12,7 @@ pub enum AppError {
/// Generic bad request. It is handled with a message value
BadRequest(String),
/// Not found error
- NotFound,
+ NotFound(String),
/// Raised when a token is not good created
TokenCreation,
/// Raised when a passed token is not valid
@@ -33,7 +33,7 @@ impl IntoResponse for AppError {
"Error with database connection".to_string(),
),
AppError::BadRequest(value) => (StatusCode::BAD_REQUEST, value),
- AppError::NotFound => (StatusCode::NOT_FOUND, "Element not found".to_string()),
+ AppError::NotFound(value) => (StatusCode::NOT_FOUND, value),
AppError::TokenCreation => (
StatusCode::INTERNAL_SERVER_ERROR,
"Token creation error".to_string(),