mirror of
https://github.com/tokio-rs/axum.git
synced 2026-08-23 00:00:15 +02:00
Use correct error type if Json serialization fails
Fixes https://github.com/davidpdrsn/axum/issues/35
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user