Exceptions (fastapi_responseschema.exceptions
)
Class BaseGenericHTTPException
class BaseGenericHTTPException(FastAPIHTTPException)
BaseClass for HTTPExceptions with additional data
__init__
def __init__(detail: Any = None,
headers: Optional[Dict[str, Any]] = None,
**extra_params: Any) -> None
Instances can be initialized with a set of extra params.
Arguments:
detail
Any, optional - The error response content. Defaults to None.headers
Optional[Dict[str, Any]], optional - A set of headers to be returned in the response. Defaults to None.
Class GenericHTTPException
class GenericHTTPException(BaseGenericHTTPException)
HTTP exception with extra data
__init__
def __init__(status_code: int,
detail: Any = None,
headers: Optional[Dict[str, Any]] = None,
**extra_params: Any) -> None
Used to raise custom exceptions with extra params.
Arguments:
status_code
int - Exception status code.detail
Any, optional - Error response content. Defaults to None.headers
Optional[Dict[str, Any]], optional - Error response data. Defaults to None.
Class BadRequest
class BadRequest(BaseGenericHTTPException)
Raises with HTTP status 400
Arguments:
detail
Any, optional - The error response content. Defaults to None.headers
Optional[Dict[str, Any]], optional - A set of headers to be returned in the response. Defaults to None.
Class Unauthorized
class Unauthorized(BaseGenericHTTPException)
Raises with HTTP status 401
Arguments:
detail
Any, optional - The error response content. Defaults to None.headers
Optional[Dict[str, Any]], optional - A set of headers to be returned in the response. Defaults to None.
Class Forbidden
class Forbidden(BaseGenericHTTPException)
Raises with HTTP status 403
Arguments:
detail
Any, optional - The error response content. Defaults to None.headers
Optional[Dict[str, Any]], optional - A set of headers to be returned in the response. Defaults to None.
Class NotFound
class NotFound(BaseGenericHTTPException)
Raises with HTTP status 404
Arguments:
detail
Any, optional - The error response content. Defaults to None.headers
Optional[Dict[str, Any]], optional - A set of headers to be returned in the response. Defaults to None.
Class MethodNotAllowed
class MethodNotAllowed(BaseGenericHTTPException)
Raises with HTTP status 405
Arguments:
detail
Any, optional - The error response content. Defaults to None.headers
Optional[Dict[str, Any]], optional - A set of headers to be returned in the response. Defaults to None.
Class Conflict
class Conflict(BaseGenericHTTPException)
Raises with HTTP status 409
Arguments:
detail
Any, optional - The error response content. Defaults to None.headers
Optional[Dict[str, Any]], optional - A set of headers to be returned in the response. Defaults to None.
Class Gone
class Gone(BaseGenericHTTPException)
Raises with HTTP status 410
Arguments:
detail
Any, optional - The error response content. Defaults to None.headers
Optional[Dict[str, Any]], optional - A set of headers to be returned in the response. Defaults to None.
Class UnprocessableEntity
class UnprocessableEntity(BaseGenericHTTPException)
Raises with HTTP status 422
Arguments:
detail
Any, optional - The error response content. Defaults to None.headers
Optional[Dict[str, Any]], optional - A set of headers to be returned in the response. Defaults to None.
Class InternalServerError
class InternalServerError(BaseGenericHTTPException)
Raises with HTTP status 500
Arguments:
detail
Any, optional - The error response content. Defaults to None.headers
Optional[Dict[str, Any]], optional - A set of headers to be returned in the response. Defaults to None.