Skip to content

Commit

Permalink
added from clause to save JsonDecodeError exception tiangolo#3993
Browse files Browse the repository at this point in the history
  • Loading branch information
UKnowWhoIm committed Oct 16, 2021
1 parent 864643e commit bcb3103
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fastapi/routing.py
Expand Up @@ -208,7 +208,7 @@ async def app(request: Request) -> Response:
else:
body = body_bytes
except json.JSONDecodeError as e:
raise RequestValidationError([ErrorWrapper(e, ("body", e.pos))], body=e.doc)
raise RequestValidationError([ErrorWrapper(e, ("body", e.pos))], body=e.doc) from e
except Exception as e:
raise HTTPException(
status_code=400, detail="There was an error parsing the body"
Expand Down

0 comments on commit bcb3103

Please sign in to comment.