Skip to content

Exceptions

Hierarchy

PiKVMError
├── APIError
│   └── AuthError
├── ConnectError
├── ConnectionTimeoutError
└── WebSocketError

Reference

PiKVMError

Base exception for all aiopikvm errors.

Source code in src/aiopikvm/_exceptions.py
class PiKVMError(Exception):
    """Base exception for all aiopikvm errors."""

APIError

Bases: PiKVMError

PiKVM API returned an error.

Attributes:

Name Type Description
status_code

HTTP status code (0 when parsed from the JSON body).

Source code in src/aiopikvm/_exceptions.py
class APIError(PiKVMError):
    """PiKVM API returned an error.

    Attributes:
        status_code: HTTP status code (``0`` when parsed from the JSON body).
    """

    def __init__(self, message: str, status_code: int = 0) -> None:
        super().__init__(message)
        self.status_code = status_code

AuthError

Bases: APIError

Authentication failed (HTTP 401/403).

Source code in src/aiopikvm/_exceptions.py
class AuthError(APIError):
    """Authentication failed (HTTP 401/403)."""

ConnectError

Bases: PiKVMError

Failed to connect to PiKVM.

Source code in src/aiopikvm/_exceptions.py
class ConnectError(PiKVMError):
    """Failed to connect to PiKVM."""

ConnectionTimeoutError

Bases: PiKVMError

Request to PiKVM timed out.

Source code in src/aiopikvm/_exceptions.py
class ConnectionTimeoutError(PiKVMError):
    """Request to PiKVM timed out."""

WebSocketError

Bases: PiKVMError

WebSocket connection error.

Source code in src/aiopikvm/_exceptions.py
class WebSocketError(PiKVMError):
    """WebSocket connection error."""