Exceptions

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

Base HTTP Exception

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

class baize.exceptions.UnsupportedMediaType(*supported_media_types: str)

415 Unsupported Media Type

class baize.exceptions.RangeNotSatisfiable(max_size: int)

416 Range Not Satisfiable

Custom HTTP exceptions

class baize.exceptions.MalformedJSON(message: str = 'Malformed JSON')
class baize.exceptions.MalformedMultipart(message: str = 'Malformed multipart')
class baize.exceptions.MalformedRangeHeader(message: str = 'Malformed Range header')