Skip to content

Exceptions

⚠️ Exceptions

Exception classes for error handling.

⚠️ Exception Classes

NetworkHD API client exceptions.

This module defines custom exception classes for the NetworkHD API client. These exceptions provide detailed error information and help with debugging.

NetworkHDError

Bases: Exception

Base exception for NetworkHD API errors

ConnectionError

Bases: NetworkHDError

Exception raised when connection fails

ConnectionLostError

ConnectionLostError(host: str, reason: str | None = None)

Bases: NetworkHDError

Exception raised when connection is unexpectedly lost

ReconnectionError

ReconnectionError(host: str, attempts: int, last_error: str)

Bases: NetworkHDError

Exception raised when reconnection attempts fail

AuthenticationError

AuthenticationError(username: str, host: str)

Bases: NetworkHDError

Exception raised when authentication fails

TimeoutError

TimeoutError(operation: str, timeout: float)

Bases: NetworkHDError

Exception raised when operations timeout

CommandError

Bases: NetworkHDError

Exception raised when command execution fails

ResponseError

Bases: NetworkHDError

Exception raised when response parsing fails

UnknownCommandError

UnknownCommandError(command: str)

Bases: NetworkHDError

Exception raised when command is not recognized

DeviceNotFoundError

DeviceNotFoundError(device_name: str)

Bases: NetworkHDError

Exception raised when a device does not exist

DeviceQueryError

DeviceQueryError(device_name: str, error_message: str)

Bases: NetworkHDError

Exception raised when device query returns error in JSON response