Skip to content

Commit

Permalink
šŸ“ Update HTTPException details in `docs/en/docs/tutorial/handling-eā€¦
Browse files Browse the repository at this point in the history
ā€¦rrors.md` (#5418)

Co-authored-by: SebastiƔn Ramƭrez <tiangolo@gmail.com>
  • Loading branch information
papb and tiangolo committed Jan 15, 2024
1 parent 2b6f12a commit cf01195
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions docs/en/docs/tutorial/handling-errors.md
Expand Up @@ -234,9 +234,7 @@ You will receive a response telling you that the data is invalid containing the

And **FastAPI**'s `HTTPException` error class inherits from Starlette's `HTTPException` error class.

The only difference, is that **FastAPI**'s `HTTPException` allows you to add headers to be included in the response.

This is needed/used internally for OAuth 2.0 and some security utilities.
The only difference is that **FastAPI**'s `HTTPException` accepts any JSON-able data for the `detail` field, while Starlette's `HTTPException` only accepts strings for it.

So, you can keep raising **FastAPI**'s `HTTPException` as normally in your code.

Expand Down

0 comments on commit cf01195

Please sign in to comment.