📝 Update `HTTPException` details in `docs/en/docs/tutorial/handling-errors.md` (#5418)

Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
This commit is contained in:
Pedro Augusto de Paula Barbosa 2024-01-15 12:17:34 -03:00 committed by GitHub
parent 2b6f12a5d0
commit cf01195555
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 3 deletions

View File

@ -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.