soco.exceptions module

Exceptions that are used by SoCo.

exception soco.exceptions.SoCoException[source]

Base class for all SoCo exceptions.

exception soco.exceptions.UnknownSoCoException[source]

An unknown UPnP error.

The exception object will contain the raw response sent back from the speaker as the first of its args.

exception soco.exceptions.SoCoUPnPException(message, error_code, error_xml, error_description='')[source]

A UPnP Fault Code, raised in response to actions sent over the network.

Parameters
  • message (str) – The message from the server.

  • error_code (str) – The UPnP Error Code as a string.

  • error_xml (str) – The xml containing the error, as a utf-8 encoded string.

  • error_description (str) – A description of the error. Default is “”

exception soco.exceptions.CannotCreateDIDLMetadata[source]

Deprecated since version 0.11: Use DIDLMetadataError instead.

exception soco.exceptions.DIDLMetadataError[source]

Raised if a data container class cannot create the DIDL metadata due to missing information.

For backward compatibility, this is currently a subclass of CannotCreateDIDLMetadata. In a future version, it will likely become a direct subclass of SoCoException.

exception soco.exceptions.MusicServiceException[source]

An error relating to a third party music service.

exception soco.exceptions.MusicServiceAuthException[source]

An error relating to authentication of a third party music service

exception soco.exceptions.UnknownXMLStructure[source]

Raised if XML with an unknown or unexpected structure is returned.

exception soco.exceptions.SoCoSlaveException[source]

Raised when a master command is called on a slave.

exception soco.exceptions.SoCoNotVisibleException[source]

Raised when a command intended for a visible speaker is called on an invisible one.

exception soco.exceptions.NotSupportedException[source]

Raised when something is not supported by the device

exception soco.exceptions.EventParseException(tag, metadata, cause)[source]

Raised when a parsing exception occurs during event handling.

tag

The tag for which the exception occured

Type

str

metadata

The metadata which failed to parse

Type

str

__cause__

The original exception

Type

Exception

Parameters
  • tag (str) – The tag for which the exception occured

  • metadata (str) – The metadata which failed to parse

  • cause (Exception) – The original exception

class soco.exceptions.SoCoFault(exception)[source]

Class to represent a failed object instantiation.

It rethrows the exception on common use.

exception

The exception which will be thrown on use

Parameters

exception (Exception) – The exception which should be thrown on use