Exceptions¶
Every exception that pysportbot raises derives from SportBotError, and all of them can be imported from pysportbot.
Network errors are the one exception: they propagate as requests.RequestException.
SportBotError
├── APIError
├── AuthenticationError
├── NotLoggedInError
├── ConfigError
├── CentreNotFoundError
├── ActivityNotFoundError
├── SlotNotFoundError
├── BookingError
│ ├── SlotAlreadyBookedError
│ ├── SlotUnavailableError
│ ├── SlotNotBookableYetError
│ └── SlotFullError
└── CancellationError
SportBotError
¶
Bases: Exception
Base class for every error raised by pysportbot.
APIError
¶
Bases: SportBotError
The API returned an unexpected HTTP status, a non-JSON body or a body with missing fields.
AuthenticationError
¶
Bases: SportBotError
Logging in failed, because of bad credentials or an unexpected authentication response.
NotLoggedInError
¶
ConfigError
¶
Bases: SportBotError
The service configuration is invalid.
CentreNotFoundError
¶
ActivityNotFoundError
¶
SlotNotFoundError
¶
BookingError
¶
Bases: SportBotError
Booking a slot failed. Raised directly for API error codes without a dedicated subclass.