Skip to content

Commit

Permalink
Make internal server error new fallback error type
Browse files Browse the repository at this point in the history
  • Loading branch information
georgeboot committed Jan 6, 2025
1 parent 6fe90ea commit aeb3f04
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/controller/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,10 +198,6 @@ impl IntoResponse for Error {
StatusCode::NOT_FOUND,
ErrorDetail::new("not_found", "Resource was not found"),
),
Self::InternalServerError => (
StatusCode::INTERNAL_SERVER_ERROR,
ErrorDetail::new("internal_server_error", "Internal Server Error"),
),
Self::Unauthorized(err) => {
tracing::warn!(err);
(
Expand All @@ -221,9 +217,13 @@ impl IntoResponse for Error {
ErrorDetail::with_reason("Bad Request"),
)
}
_ => (
Self::BadRequest(err) => (
StatusCode::BAD_REQUEST,
ErrorDetail::with_reason("Bad Request"),
ErrorDetail::new("Bad Request", &err),
),
_ => (
StatusCode::INTERNAL_SERVER_ERROR,
ErrorDetail::new("internal_server_error", "Internal Server Error"),
),
};

Expand Down

0 comments on commit aeb3f04

Please sign in to comment.