Add rejection tracing to all extractors (#2584)

This commit is contained in:
David Mládek
2024-03-16 22:34:18 +01:00
committed by GitHub
parent 2ce382f0ab
commit 2ec68d6c4d
8 changed files with 46 additions and 18 deletions
+3 -2
View File
@@ -274,12 +274,13 @@ impl std::error::Error for MultipartError {
impl IntoResponse for MultipartError {
fn into_response(self) -> Response {
let body = self.body_text();
axum_core::__log_rejection!(
rejection_type = Self,
body_text = self.body_text(),
body_text = body,
status = self.status(),
);
(self.status(), self.body_text()).into_response()
(self.status(), body).into_response()
}
}
+10 -3
View File
@@ -398,12 +398,13 @@ impl FailedToDeserializePathParams {
impl IntoResponse for FailedToDeserializePathParams {
fn into_response(self) -> Response {
let body = self.body_text();
axum_core::__log_rejection!(
rejection_type = Self,
body_text = self.body_text(),
body_text = body,
status = self.status(),
);
(self.status(), self.body_text()).into_response()
(self.status(), body).into_response()
}
}
@@ -530,7 +531,13 @@ impl std::error::Error for InvalidUtf8InPathParam {}
impl IntoResponse for InvalidUtf8InPathParam {
fn into_response(self) -> Response {
(self.status(), self.body_text()).into_response()
let body = self.body_text();
axum_core::__log_rejection!(
rejection_type = Self,
body_text = body,
status = self.status(),
);
(self.status(), body).into_response()
}
}