forked from alemi/upub
fix: upub error reports status codes as-is
This commit is contained in:
parent
861cd2297b
commit
2031d8de41
1 changed files with 5 additions and 4 deletions
|
@ -59,10 +59,11 @@ impl From<axum::http::StatusCode> for UpubError {
|
|||
|
||||
impl axum::response::IntoResponse for UpubError {
|
||||
fn into_response(self) -> axum::response::Response {
|
||||
(
|
||||
axum::http::StatusCode::INTERNAL_SERVER_ERROR,
|
||||
self.to_string()
|
||||
).into_response()
|
||||
let descr = self.to_string();
|
||||
match self {
|
||||
UpubError::Status(status) => (status, descr).into_response(),
|
||||
_ => (axum::http::StatusCode::INTERNAL_SERVER_ERROR, descr).into_response(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue