Exceptions

Custom exceptions and exception mapping for aiopnsense.

exception aiopnsense.exceptions.OPNsenseError[source]

Bases: Exception

Base exception for aiopnsense errors.

exception aiopnsense.exceptions.OPNsenseConnectionError(message='', *, status=None)[source]

Bases: OPNsenseError

Base exception for OPNsense connection failures.

Initialize an OPNsense connection failure.

Parameters:
  • message (str) – Human-readable failure detail.

  • status (int | None) – HTTP status associated with the failure, when available.

Return type:

None

exception aiopnsense.exceptions.OPNsenseTimeoutError(message='', *, status=None)[source]

Bases: OPNsenseConnectionError

Raised when a request to OPNsense times out.

Initialize an OPNsense connection failure.

Parameters:
  • message (str) – Human-readable failure detail.

  • status (int | None) – HTTP status associated with the failure, when available.

Return type:

None

exception aiopnsense.exceptions.OPNsenseSSLError(message='', *, status=None)[source]

Bases: OPNsenseConnectionError

Raised when an SSL error occurs during communication with OPNsense.

Initialize an OPNsense connection failure.

Parameters:
  • message (str) – Human-readable failure detail.

  • status (int | None) – HTTP status associated with the failure, when available.

Return type:

None

exception aiopnsense.exceptions.OPNsenseInvalidURL(message='', *, status=None)[source]

Bases: OPNsenseConnectionError

Raised when an OPNsense URL is invalid.

Initialize an OPNsense connection failure.

Parameters:
  • message (str) – Human-readable failure detail.

  • status (int | None) – HTTP status associated with the failure, when available.

Return type:

None

exception aiopnsense.exceptions.OPNsenseInvalidAuth(message='', *, status=None)[source]

Bases: OPNsenseConnectionError

Raised when OPNsense authentication fails.

Initialize an OPNsense connection failure.

Parameters:
  • message (str) – Human-readable failure detail.

  • status (int | None) – HTTP status associated with the failure, when available.

Return type:

None

exception aiopnsense.exceptions.OPNsensePrivilegeMissing(message='', *, status=None)[source]

Bases: OPNsenseConnectionError

Raised when the authenticated user lacks required privileges.

Initialize an OPNsense connection failure.

Parameters:
  • message (str) – Human-readable failure detail.

  • status (int | None) – HTTP status associated with the failure, when available.

Return type:

None

exception aiopnsense.exceptions.OPNsenseBelowMinFirmware[source]

Bases: OPNsenseError

Raised when the detected firmware is below the supported minimum.

exception aiopnsense.exceptions.OPNsenseMissingDeviceUniqueID[source]

Bases: OPNsenseError

Raised when no device unique ID can be derived from OPNsense.

exception aiopnsense.exceptions.OPNsenseVoucherServerError[source]

Bases: OPNsenseError

Error from Voucher Server.

exception aiopnsense.exceptions.OPNsenseUnknownFirmware[source]

Bases: OPNsenseError

Unknown current firmware version.

exception aiopnsense.exceptions.OPNsenseInvalidArgument[source]

Bases: OPNsenseError, TypeError

Raised when an aiopnsense argument has an invalid type or value.