Exceptions

Gateway

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
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

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.network.errors.WebSocketError(original: WSErrorType)[source]

Exception raised when a websocket error occurrs.

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.