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."""
|