mirror of https://github.com/tiangolo/fastapi.git
📝 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:
parent
2b6f12a5d0
commit
cf01195555
|
|
@ -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.
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue