Skip to content

exceptions

BadRequest (HTTPException)

400 Bad Request

Forbidden (HTTPException)

403 Forbidden

HTTPException (HTTPException, ABC)

This abstract class makes it easier to subclass FastAPI's HTTPException with new status codes.

It can also be useful when testing requires a string representation of an exception that contains the HTTPException detail string, rather than the standard Python exception message.

Attributes:

Name Type Description
status_code int

The HTTP status code accompanying this exception.

title str

A descriptive title for this exception.

InternalServerError (HTTPException)

500 Internal Server Error

NotFound (HTTPException)

404 Not Found

NotImplementedResponse (HTTPException)

501 Not Implemented

UnprocessableEntity (HTTPException)

422 Unprocessable Entity

VersionNotSupported (HTTPException)

553 Version Not Supported