File: error.py

package info (click to toggle)
pychromecast 0.7.7-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 288 kB
  • ctags: 936
  • sloc: python: 1,495; makefile: 6
file content (63 lines) | stat: -rw-r--r-- 1,334 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
"""
Errors to be used by PyChromecast.
"""


class PyChromecastError(Exception):
    """ Base error for PyChromecast. """
    pass


class NoChromecastFoundError(PyChromecastError):
    """
    When a command has to auto-discover a Chromecast and cannot find one.
    """
    pass


class MultipleChromecastsFoundError(PyChromecastError):
    """
    When getting a singular chromecast results in getting multiple chromecasts.
    """
    pass


class ChromecastConnectionError(PyChromecastError):
    """ When a connection error occurs within PyChromecast. """
    pass


class LaunchError(PyChromecastError):
    """ When an app fails to launch. """
    pass


class PyChromecastStopped(PyChromecastError):
    """ Raised when a command is invoked while the Chromecast's socket_client
    is stopped.

    """
    pass


class NotConnected(PyChromecastError):
    """
    Raised when a command is invoked while not connected to a Chromecast.
    """
    pass


class UnsupportedNamespace(PyChromecastError):
    """
    Raised when trying to send a message with a namespace that is not
    supported by the current running app.
    """
    pass


class ControllerNotRegistered(PyChromecastError):
    """
    Raised when trying to interact with a controller while it is
    not registered with a ChromeCast object.
    """
    pass