File: exceptions.py

package info (click to toggle)
python-nextdns 3.3.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 312 kB
  • sloc: python: 1,548; sh: 10; makefile: 3
file content (30 lines) | stat: -rw-r--r-- 716 bytes parent folder | download
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
"""NextDNS exceptions."""


class NextDnsError(Exception):
    """Base class for nextdns errors."""


class InvalidApiKeyError(NextDnsError):
    """Raised to indicate invalid API key error."""


class ApiError(NextDnsError):
    """Raised to indicate API error."""

    def __init__(self, status: str) -> None:
        """Initialize."""
        super().__init__(status)
        self.status = status


class ProfileIdNotFoundError(NextDnsError):
    """Raised to indicate profile ID not found error."""


class ProfileNameNotFoundError(NextDnsError):
    """Raised to indicate profile name not found error."""


class SettingNotSupportedError(NextDnsError):
    """Raised to indicate setting not supported error."""