mirror of
https://github.com/tokio-rs/axum.git
synced 2025-10-02 07:20:38 +00: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
@ -229,6 +229,7 @@ where
|
|||||||
Ok(res) => res,
|
Ok(res) => res,
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
return Response::builder()
|
return Response::builder()
|
||||||
|
.status(StatusCode::INTERNAL_SERVER_ERROR)
|
||||||
.header(header::CONTENT_TYPE, "text/plain")
|
.header(header::CONTENT_TYPE, "text/plain")
|
||||||
.body(Body::from(err.to_string()))
|
.body(Body::from(err.to_string()))
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user