Added query parameters.
This commit is contained in:
+6
-3
@@ -29,15 +29,18 @@ impl IntoResponse for AppError {
|
||||
Self::NotFound => {
|
||||
return error_response(StatusCode::NOT_FOUND, "Not found");
|
||||
}
|
||||
Self::Validation(error) => {
|
||||
return error_response(StatusCode::UNPROCESSABLE_ENTITY, error.to_string());
|
||||
}
|
||||
Self::Repository(RepositoryError::Database(error)) => {
|
||||
tracing::error!(%error, "Database query failed");
|
||||
}
|
||||
Self::Repository(RepositoryError::Decode(error)) => {
|
||||
tracing::error!(%error, "Invalid stored data");
|
||||
}
|
||||
Self::Repository(RepositoryError::QueryConversion(error)) => {
|
||||
return error_response(StatusCode::BAD_REQUEST, error.to_string());
|
||||
}
|
||||
Self::Validation(error) => {
|
||||
return error_response(StatusCode::UNPROCESSABLE_ENTITY, error.to_string());
|
||||
}
|
||||
}
|
||||
|
||||
error_response(StatusCode::INTERNAL_SERVER_ERROR, "Internal server error")
|
||||
|
||||
Reference in New Issue
Block a user