Skip to content

pywry.exceptions

Exception hierarchy for PyWry error handling.


pywry.exceptions.PyWryException

PyWryException(message: str, **context: Any)

Bases: Exception

Base exception for all PyWry errors.

Initialize PyWry exception.

PARAMETER DESCRIPTION
message

Human-readable error message.

TYPE: str

**context

Additional context (label, method, request_id, etc.).

TYPE: Any DEFAULT: {}

Functions

pywry.exceptions.WindowError

WindowError(message: str, label: str | None = None, **context: Any)

Bases: PyWryException

Window operation failed.

Raised when a window is not found, already destroyed, or an operation cannot be performed on it.

Initialize window error.

PARAMETER DESCRIPTION
message

Human-readable error message.

TYPE: str

label

The window label that caused the error.

TYPE: str DEFAULT: None

**context

Additional context.

TYPE: Any DEFAULT: {}

Functions

pywry.exceptions.IPCError

IPCError(message: str, action: str | None = None, label: str | None = None, **context: Any)

Bases: PyWryException

IPC communication failed.

Raised when communication with the subprocess fails, including encoding/decoding errors and pipe failures.

Initialize IPC error.

PARAMETER DESCRIPTION
message

Human-readable error message.

TYPE: str

action

The IPC action that failed.

TYPE: str DEFAULT: None

label

The window label involved.

TYPE: str DEFAULT: None

**context

Additional context.

TYPE: Any DEFAULT: {}

Functions

pywry.exceptions.IPCTimeoutError

IPCTimeoutError(message: str, timeout: float, action: str | None = None, label: str | None = None, **context: Any)

Bases: IPCError

IPC response timeout.

Raised when waiting for a subprocess response exceeds the configured timeout.

Initialize timeout error.

PARAMETER DESCRIPTION
message

Human-readable error message.

TYPE: str

timeout

The timeout value in seconds.

TYPE: float

action

The IPC action that timed out.

TYPE: str DEFAULT: None

label

The window label involved.

TYPE: str DEFAULT: None

**context

Additional context.

TYPE: Any DEFAULT: {}

Functions

pywry.exceptions.PropertyError

PropertyError(message: str, property_name: str, label: str | None = None, **context: Any)

Bases: PyWryException

Failed to get or set a window property.

Raised when a property access or modification fails, typically due to the property not existing or being read-only.

Initialize property error.

PARAMETER DESCRIPTION
message

Human-readable error message.

TYPE: str

property_name

The property that caused the error.

TYPE: str

label

The window label involved.

TYPE: str DEFAULT: None

**context

Additional context.

TYPE: Any DEFAULT: {}

Functions

pywry.exceptions.SubprocessError

SubprocessError(message: str, exit_code: int | None = None, **context: Any)

Bases: PyWryException

Subprocess-related error.

Raised when the pytauri subprocess fails to start, crashes unexpectedly, or returns an error.

Initialize subprocess error.

PARAMETER DESCRIPTION
message

Human-readable error message.

TYPE: str

exit_code

The subprocess exit code if available.

TYPE: int DEFAULT: None

**context

Additional context.

TYPE: Any DEFAULT: {}

Functions