feat: Try log original server error

This commit is contained in:
Jade Ellis 2026-02-05 21:08:08 +00:00 committed by Ellis Git
parent f6df44b13f
commit 7369b58d91

View file

@ -14,6 +14,25 @@ use crate::error;
impl axum::response::IntoResponse for Error {
fn into_response(self) -> axum::response::Response {
let status = self.status_code();
if status.is_server_error() {
error!(
error = %self,
error_debug = ?self,
kind = ?self.kind(),
status = %status,
"Server error"
);
} else if status.is_client_error() {
use crate::debug_error;
debug_error!(
error = %self,
kind = ?self.kind(),
status = %status,
"Client error"
);
}
let response: UiaaResponse = self.into();
response
.try_into_http_response::<BytesMut>()