Exceptions

Contains all the internally defined exceptions used by the library.

exception flightplandb.exceptions.BaseErrorHandler(status_code: int, message: str)

Base exception. The other exceptions all inherit from this one, but this exception will be raised directly if no others match the returned HTTP status code.

status_code

Status code of the error

message

Description of the error

exception flightplandb.exceptions.BadRequestException(status_code: int, message: str)

An incorrect request was made to the server. Raised for an HTTP status code 400.

status_code

Status code of the error

message

A verbose description of this error.

exception flightplandb.exceptions.UnauthorizedException(status_code: int, message: str)

You are incorrectly authorised and may not make this request. Raised for an HTTP status code 401.

status_code

Status code of the error

message

A verbose description of this error.

exception flightplandb.exceptions.ForbiddenException(status_code: int, message: str)

The server refuses to fulfill this request, for instance due to insufficient authentication. Raised for an HTTP status code 403.

status_code

Status code of the error

message

A verbose description of this error.

exception flightplandb.exceptions.NotFoundException(status_code: int, message: str)

The server couldn't find a resource matching the request. Raised for an HTTP status code 404.

status_code

Status code of the error

message

A verbose description of this error.

exception flightplandb.exceptions.TooManyRequestsException(status_code: int, message: str)

Your requests limit for the server has been exceeded. Raised for an HTTP status code 429.

status_code

Status code of the error

message

A verbose description of this error.

exception flightplandb.exceptions.InternalServerException(status_code: int, message: str)

Something unspecified went wrong with the server. Raised for an HTTP status code 500.

status_code

Status code of the error

message

A verbose description of this error.

flightplandb.exceptions.status_handler(status_code: int, ignore_statuses: Tuple[int] | Tuple = ()) None

Raises correct custom exception for appropriate HTTP status code.