]> git.ipfire.org Git - thirdparty/fastapi/fastapi.git/commitdiff
📝 Update `HTTPException` details in `docs/en/docs/tutorial/handling-errors.md` (...
authorPedro Augusto de Paula Barbosa <papb1996@gmail.com>
Mon, 15 Jan 2024 15:17:34 +0000 (12:17 -0300)
committerGitHub <noreply@github.com>
Mon, 15 Jan 2024 15:17:34 +0000 (16:17 +0100)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
docs/en/docs/tutorial/handling-errors.md

index a03029e8113567a7ce8d342468936affd0859a44..7d521696d88ef6353325330095b35b9f6ad61d3f 100644 (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.