mirror of
https://github.com/tokio-rs/axum.git
synced 2025-03-13 19:27:53 +01:00
Use correct error type if Json
serialization fails
Fixes https://github.com/davidpdrsn/axum/issues/35
This commit is contained in:
parent
f32d325e55
commit
a658c94f23
1 changed files with 1 additions and 0 deletions
|
@ -229,6 +229,7 @@ where
|
|||
Ok(res) => res,
|
||||
Err(err) => {
|
||||
return Response::builder()
|
||||
.status(StatusCode::INTERNAL_SERVER_ERROR)
|
||||
.header(header::CONTENT_TYPE, "text/plain")
|
||||
.body(Body::from(err.to_string()))
|
||||
.unwrap();
|
||||
|
|
Loading…
Add table
Reference in a new issue