Exceptions & Error Handling#

Exceptions and error handling for stravalib. These are classes designed to capture and handle various errors encountered when interacting with the Strava API.

exception stravalib.exc.AuthError[source]#

Bases: RuntimeError

exception stravalib.exc.LoginFailed[source]#

Bases: AuthError

exception stravalib.exc.LoginRequired[source]#

Bases: AuthError

Login is required to perform specified action.

exception stravalib.exc.UnboundEntity[source]#

Bases: RuntimeError

Exception used to indicate that a model Entity is not bound to client instances.

exception stravalib.exc.Fault(*args, **kwargs)[source]#

Bases: HTTPError

Container for exceptions raised by the remote server.

exception stravalib.exc.ObjectNotFound(*args, **kwargs)[source]#

Bases: Fault

When we get a 404 back from an API call.

exception stravalib.exc.AccessUnauthorized(*args, **kwargs)[source]#

Bases: Fault

When we get a 401 back from an API call.

exception stravalib.exc.RateLimitExceeded(msg, timeout=None, limit=None)[source]#

Bases: RuntimeError

Exception raised when the client rate limit has been exceeded.

https://developers.strava.com/docs/rate-limits/

exception stravalib.exc.RateLimitTimeout(msg, timeout=None, limit=None)[source]#

Bases: RateLimitExceeded

Exception raised when the client rate limit has been exceeded and the time to clear the limit (timeout) has not yet been reached

https://developers.strava.com/docs/rate-limits/

exception stravalib.exc.ActivityUploadFailed[source]#

Bases: RuntimeError

exception stravalib.exc.ErrorProcessingActivity[source]#

Bases: ActivityUploadFailed

exception stravalib.exc.CreatedActivityDeleted[source]#

Bases: ActivityUploadFailed

exception stravalib.exc.ActivityPhotoUploadFailed[source]#

Bases: RuntimeError

exception stravalib.exc.ActivityPhotoUploadNotSupported[source]#

Bases: ActivityPhotoUploadFailed

exception stravalib.exc.TimeoutExceeded[source]#

Bases: RuntimeError

exception stravalib.exc.NotAuthenticatedAthlete[source]#

Bases: AuthError

Exception when trying to access data which requires an authenticated athlete

stravalib.exc.warn_method_deprecation(klass: Type, method_name: str, alternative: str, alt_url: Optional[str] = None)[source]#
stravalib.exc.warn_param_unsupported(param_name: str)[source]#
stravalib.exc.warn_param_deprecation(param_name: str, alternative: str, alt_url: Optional[str] = None)[source]#
stravalib.exc.warn_param_unofficial(param_name: str)[source]#
stravalib.exc.warn_attribute_unofficial(attr_name: str)[source]#
stravalib.exc.warn_method_unofficial(method_name: str)[source]#
stravalib.exc.warn_units_deprecated()[source]#