--- layout: template title: API - pyatv.exceptions permalink: /api/exceptions/ link_group: api ---

# Module `pyatv.exceptions`

Local exceptions used by library.

Browse git

## Classes

`class AuthenticationError (*args, **kwargs)`

  Thrown when authentication fails.

  Browse git

  ### Ancestors

  - builtins.Exception
  - builtins.BaseException
`class BackOffError (*args, **kwargs)`

  Thrown when device mandates a backoff period.

  Browse git

  ### Ancestors

  - builtins.Exception
  - builtins.BaseException
`class BlockedStateError (*args, **kwargs)`

  Thrown when calling a blocked method.

  Typically, public interface methods (e.g. any method available via the object returned by `connect()`) becomes blocked after either calling close or because the connection was closed for some other reason.

  Browse git

  ### Ancestors

  - builtins.Exception
  - builtins.BaseException
`class CommandError (*args, **kwargs)`

  Thrown when a command (e.g. play or pause) failed.

  Browse git

  ### Ancestors

  - builtins.Exception
  - builtins.BaseException
`class ConnectionFailedError (*args, **kwargs)`

  Thrown when connection fails, e.g. refused or timed out.

  Browse git

  ### Ancestors

  - builtins.Exception
  - builtins.BaseException
`class ConnectionLostError (*args, **kwargs)`

  Thrown when a connection is lost.

  Browse git

  ### Ancestors

  - builtins.Exception
  - builtins.BaseException
`class DeviceIdMissingError (*args, **kwargs)`

  Thrown when device id is missing.

  Browse git

  ### Ancestors

  - builtins.Exception
  - builtins.BaseException
`class HttpError (message: str, status_code: int)`

  Thrown when a HTTP error occurs.

  Initialize a new HttpError.

  Browse git

  ### Ancestors

  - ProtocolError
  - builtins.Exception
  - builtins.BaseException

  ### Instance variables

  `var status_code -> int`

    Return status code that triggered the error.

    Browse git
`class InvalidConfigError (*args, **kwargs)`

  Thrown when something is wrong or missing in the config.

  Browse git

  ### Ancestors

  - builtins.Exception
  - builtins.BaseException
`class InvalidCredentialsError (*args, **kwargs)`

  Thrown if credentials are invalid.

  Browse git

  ### Ancestors

  - builtins.Exception
  - builtins.BaseException
`class InvalidDmapDataError (*args, **kwargs)`

  Thrown when invalid DMAP data is parsed.

  Browse git

  ### Ancestors

  - builtins.Exception
  - builtins.BaseException
`class InvalidResponseError (*args, **kwargs)`

  Thrown when a remote sends an invalid response.

  Browse git

  ### Ancestors

  - builtins.Exception
  - builtins.BaseException
`class InvalidStateError (*args, **kwargs)`

  Thrown when trying to perform an action not possible in the current state.

  Browse git

  ### Ancestors

  - builtins.Exception
  - builtins.BaseException
`class NoAsyncListenerError (*args, **kwargs)`

  Thrown when starting AsyncUpdater with no listener.

  Browse git

  ### Ancestors

  - builtins.Exception
  - builtins.BaseException
`class NoCredentialsError (*args, **kwargs)`

  Thrown if credentials are missing.

  Browse git

  ### Ancestors

  - builtins.Exception
  - builtins.BaseException
`class NoServiceError (*args, **kwargs)`

  Thrown when connecting to a device with no usable service.

  Browse git

  ### Ancestors

  - builtins.Exception
  - builtins.BaseException
`class NonLocalSubnetError (*args, **kwargs)`

  Thrown when address it not in any local subnet.

  DEPRECATED: Not used since 0.7.1. Will be removed in 0.9.0!

  Browse git

  ### Ancestors

  - builtins.Exception
  - builtins.BaseException
`class NotSupportedError (*args, **kwargs)`

  Thrown when trying to perform an action that is not supported.

  Browse git

  ### Ancestors

  - builtins.NotImplementedError
  - builtins.RuntimeError
  - builtins.Exception
  - builtins.BaseException
`class OperationTimeoutError (*args, **kwargs)`

  Raised when a timeout happens.

  Browse git

  ### Ancestors

  - builtins.Exception
  - builtins.BaseException
`class PairingError (*args, **kwargs)`

  Thrown when pairing fails.

  Browse git

  ### Ancestors

  - builtins.Exception
  - builtins.BaseException
`class PlaybackError (*args, **kwargs)`

  Thrown when media playback failed.

  Browse git

  ### Ancestors

  - builtins.Exception
  - builtins.BaseException
`class ProtocolError (*args, **kwargs)`

  Thrown when a generic protocol error occurs.

  Generic protocol errors includes for instance missing fields, incorrect or unexpected types, etc. Any error that can happen when communicating with a device that is not covered by another exception is covered by this exception.

  Browse git

  ### Ancestors

  - builtins.Exception
  - builtins.BaseException

  ### Subclasses

  - HttpError
`class SettingsError (*args, **kwargs)`

  Raised when an error related to settings happens.

  Browse git

  ### Ancestors

  - builtins.Exception
  - builtins.BaseException
`class UnknownMediaKindError (*args, **kwargs)`

  Thrown when an unknown media kind is found.

  Browse git

  ### Ancestors

  - builtins.Exception
  - builtins.BaseException
`class UnknownPlayStateError (*args, **kwargs)`

  Thrown when an unknown play state is found.

  Browse git

  ### Ancestors

  - builtins.Exception
  - builtins.BaseException
`class UnsupportedProtocolError (*args, **kwargs)`

  Thrown when an unsupported protocol was requested.

  DEPRECATED: Not used since 0.8.0. Will be removed in 0.10.0!

  Browse git

  ### Ancestors

  - builtins.Exception
  - builtins.BaseException