Exceptions

HTTPException

class baize.exceptions.HTTPException(status_code: int = 400, headers: Optional[Mapping[str, str]] = None, content: Optional[T] = None)

Base HTTP Exception

abort

baize.exceptions.abort(status_code: int = 400, headers: Optional[Mapping[str, str]] = None, content: Optional[Any] = None)NoReturn

raise a HTTPException. Parameters are completely consistent with HTTPException.

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')