File: exception.py

package info (click to toggle)
python-yolink-api 0.6.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 184 kB
  • sloc: python: 1,147; makefile: 2
file content (35 lines) | stat: -rw-r--r-- 667 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
"""YoLink Client Error."""


class YoLinkError(Exception):
    """YoLink Error."""


class YoLinkClientError(YoLinkError):
    """YoLink Client Error.

    code: Error Code
    desc: Desc or Error
    """

    def __init__(
        self,
        code: str,
        desc: str,
    ) -> None:
        """Initialize the yolink api error."""

        self.code = code
        self.message = desc


class YoLinkAuthFailError(YoLinkClientError):
    """YoLink Auth Fail"""


class YoLinkDeviceConnectionFailed(YoLinkClientError):
    """YoLink device connection failed."""


class YoLinkUnSupportedMethodError(YoLinkClientError):
    """YoLink Unsupported method error."""