From: Pedro Augusto de Paula Barbosa Date: Mon, 15 Jan 2024 15:17:34 +0000 (-0300) Subject: 📝 Update `HTTPException` details in `docs/en/docs/tutorial/handling-errors.md` (... X-Git-Tag: 0.109.1~216 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cf01195555ea0111a9540bccc1444b9d802587da;p=thirdparty%2Ffastapi%2Ffastapi.git 📝 Update `HTTPException` details in `docs/en/docs/tutorial/handling-errors.md` (#5418) Co-authored-by: Sebastián Ramírez --- diff --git a/docs/en/docs/tutorial/handling-errors.md b/docs/en/docs/tutorial/handling-errors.md index a03029e811..7d521696d8 100644 --- a/docs/en/docs/tutorial/handling-errors.md +++ b/docs/en/docs/tutorial/handling-errors.md @@ -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.