fix: upub error reports status codes as-is

This commit is contained in:
əlemi 2024-04-13 04:08:45 +02:00
parent 861cd2297b
commit 2031d8de41
Signed by: alemi
GPG key ID: A4895B84D311642C

View file

@ -59,10 +59,11 @@ impl From<axum::http::StatusCode> for UpubError {
impl axum::response::IntoResponse for UpubError { impl axum::response::IntoResponse for UpubError {
fn into_response(self) -> axum::response::Response { fn into_response(self) -> axum::response::Response {
( let descr = self.to_string();
axum::http::StatusCode::INTERNAL_SERVER_ERROR, match self {
self.to_string() UpubError::Status(status) => (status, descr).into_response(),
).into_response() _ => (axum::http::StatusCode::INTERNAL_SERVER_ERROR, descr).into_response(),
}
} }
} }