Exceptions¶
Basic HTTP Exception¶
HTTPException¶
- class baize.exceptions.HTTPException(status_code: int = 400, headers: Mapping[str, str] | None = None, content: T | None = None)¶
Base HTTP Exception
abort¶
- baize.exceptions.abort(status_code: int = 400, headers: Mapping[str, str] | None = None, content: Any = None) NoReturn ¶
raise a
HTTPException
. Parameters are completely consistent withHTTPException
.
Standard HTTP exceptions¶
UnsupportedMediaType¶
- class baize.exceptions.UnsupportedMediaType(*supported_media_types: str)¶
415 Unsupported Media Type
RangeNotSatisfiable¶
- class baize.exceptions.RangeNotSatisfiable(max_size: int)¶
416 Range Not Satisfiable
Custom HTTP exceptions¶
MalformedJSON¶
- class baize.exceptions.MalformedJSON(message: str = 'Malformed JSON')¶
MalformedMultipart¶
- class baize.exceptions.MalformedMultipart(message: str = 'Malformed multipart')¶
MalformedRangeHeader¶
- class baize.exceptions.MalformedRangeHeader(message: str = 'Malformed Range header')¶