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 {
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(),
}
}
}