Skip to content

Exceptions

OtfError

Bases: Exception

Base class for all exceptions in this package.

OtfRequestError

Bases: OtfError

Raised when an error occurs while making a request to the OTF API.

RetryableOtfRequestError

Bases: OtfRequestError

Raised when a request to the OTF API fails but can be retried.

This is typically used for transient errors that may resolve on retry.

BookingError

Bases: OtfError

Base class for booking-related errors, with an optional booking UUID attribute.

AlreadyBookedError

Bases: BookingError

Raised when attempting to book a class that is already booked.

ConflictingBookingError

Bases: BookingError

Raised when attempting to book a class that conflicts with an existing booking.

BookingAlreadyCancelledError

Bases: BookingError

Raised when attempting to cancel a booking that is already cancelled.

OutsideSchedulingWindowError

Bases: BookingError

Raised when attempting to book a class outside the scheduling window.

ResourceNotFoundError

Bases: OtfError

Raised when a resource is not found.

AlreadyRatedError

Bases: OtfError

Raised when attempting to rate a class that is already rated.

ClassNotRatableError

Bases: OtfError

Raised when attempting to rate a class that is not ratable.

NoCredentialsError

Bases: OtfError

Raised when no credentials are provided and no cached tokens are available.