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
|
"""Exceptions for Arr Api Client."""
from __future__ import annotations
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from aiohttp import ClientResponse
from .request_client import RequestClient
class ArrException(Exception):
"""Base arr exception."""
def __init__(
self,
client: RequestClient | None = None,
message: str | BaseException | ClientResponse | Exception = "",
) -> None:
"""Initialize."""
super().__init__(str(message) if client is not None else message)
class ArrAuthenticationException(ArrException):
"""Arr authentication exception."""
class ArrConnectionException(ArrException):
"""Arr connection exception."""
class ArrResourceNotFound(ArrException):
"""Arr resource not found exception."""
class ArrWrongAppException(ArrException):
"""Arr wrong application exception."""
class ArrZeroConfException(ArrException):
"""Arr Zero Configuration failed exception."""
|