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 authored Dec 18, 2024
1 parent 481e1d0 commit 38f0e43
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/controller/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,11 +219,15 @@ impl IntoResponse for Error {
StatusCode::BAD_REQUEST,
ErrorDetail::with_reason("Bad Request"),
)
}
_ => (
},
Self::BadRequest => (
StatusCode::BAD_REQUEST,
ErrorDetail::with_reason("Bad Request"),
),
_ => (
StatusCode::INTERNAL_SERVER_ERROR,
ErrorDetail::new("internal_server_error", "Internal Server Error"),
),
};

(public_facing_error.0, Json(public_facing_error.1)).into_response()
Expand Down

0 comments on commit 38f0e43

Please sign in to comment.