More debug info when try_from_http_request fails

This commit is contained in:
Jonathan de Jong 2022-10-17 18:41:59 +02:00
parent ada15ceacc
commit 215d909e59

View file

@ -281,7 +281,10 @@ where
debug!("{:?}", http_request);
let body = T::try_from_http_request(http_request, &path_params).map_err(|e| {
warn!("{:?}\n{:?}", e, json_body);
warn!(
"try_from_http_request failed: {:?}\nJSON body: {:?}",
e, json_body
);
Error::BadRequest(ErrorKind::BadJson, "Failed to deserialize request.")
})?;