Exceptions

Gateway

exception sonolink.AutoPlaySeedMissing[source]

Exception raised when AutoPlay cannot find a valid track to use as a discovery seed.

Added in version 1.1.0.

add_note(object, /)

Exception.add_note(note) – add a note to the exception

with_traceback(object, /)

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

args
exception sonolink.FrameworkClientMismatch(*, expected_type: type, received_type: type, framework: FrameworkLiteral)[source]

Exception raised when trying to initialize a Sonolink Client with a client that does not match the detected framework. This likely means the client is from a different framework or the framework detection is incorrect.

Added in version 1.1.0.

add_note(object, /)

Exception.add_note(note) – add a note to the exception

with_traceback(object, /)

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

args
expected_type: type

The expected framework type.

framework: FrameworkLiteral

The detected framework.

received_type: type

The actual framework type.

exception sonolink.FrameworkImportError(*, framework: FrameworkLiteral)[source]

Exception raised when trying to initialize a Sonolink Client with a framework’s client, but the framework cannot be imported. This likely means the framework is not installed, there is an issue with the installation or the framework detection is incorrect.

Added in version 1.1.0.

add_note(object, /)

Exception.add_note(note) – add a note to the exception

with_traceback(object, /)

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

args
framework: FrameworkLiteral

The detected framework.

exception sonolink.HistoryEmpty[source]

Exception raised when trying to get a track from an empty history.

add_note(object, /)

Exception.add_note(note) – add a note to the exception

with_traceback(object, /)

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

args
exception sonolink.InvalidNodePassword(node: Node)[source]

Exception raised when a Node attempts to connect with an invalid password.

add_note(object, /)

Exception.add_note(note) – add a note to the exception

with_traceback(object, /)

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

args
node: Node

The node that failed connecting.

exception sonolink.NodeURINotFound(node: Node)[source]

Exception raised when a Node’s uri is not found when connecting.

add_note(object, /)

Exception.add_note(note) – add a note to the exception

with_traceback(object, /)

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

args
node: Node

The Node which URI is not found.

exception sonolink.QueueEmpty[source]

Exception raised when trying to get a track from an empty queue.

add_note(object, /)

Exception.add_note(note) – add a note to the exception

with_traceback(object, /)

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

args

Rest

class sonolink.ErrorResponseType(*, timestamp: int, status: int, error: str, path: str, message: str | None = None, trace: str | None = None)[source]
Methods

Represents the error response on a HTTP request.

to_dict() dict[str, Any][source]
error: str
message: str | None
path: str
status: int
timestamp: int
trace: str | None
exception sonolink.HTTPException(data: bytes)[source]

An error response received by a HTTP request.

add_note(object, /)

Exception.add_note(note) – add a note to the exception

with_traceback(object, /)

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

args
property error: str

The status’ code message.

property message: str | None

The error message.

property path: str

The path that caused the error.

property status: int

The status code of the request.

timestamp

The timestamp on which this exception was created.

property trace: str | None

The stack trace of the error.

Network

exception sonolink.WebSocketError(original: WSErrorType)[source]

Exception raised when a websocket error occurs.

add_note(object, /)

Exception.add_note(note) – add a note to the exception

with_traceback(object, /)

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

args
property code: int

The code of the websocket error.

property message: str | None

The message of the websocket error.

property status: int

The status code of the websocket.