Error handling

exception spotify.Error[source]

A Spotify error.

This is the superclass of all custom exceptions raised by pyspotify.

classmethod maybe_raise(error_type, ignores=None)[source]

Raise an LibError unless the error_type is ErrorType.OK or in the ignores list of error types.

Internal method.

class spotify.ErrorType[source]
exception spotify.LibError(error_type)[source]

A libspotify error.

Where many libspotify functions return error codes that must be checked after each and every function call, pyspotify raises the LibError exception instead. This helps you to not accidentally swallow and hide errors when using pyspotify.

error_type = None

The ErrorType of the error.

exception spotify.Timeout(timeout)[source]

Exception raised by an operation not completing within the given timeout.