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.

Parameters:

Name Type Description Default
message str

Human-readable error message.

required
**context Any

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

{}

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.

Parameters:

Name Type Description Default
message str

Human-readable error message.

required
label str

The window label that caused the error.

None
**context Any

Additional context.

{}

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.

Parameters:

Name Type Description Default
message str

Human-readable error message.

required
action str

The IPC action that failed.

None
label str

The window label involved.

None
**context Any

Additional context.

{}

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.

Parameters:

Name Type Description Default
message str

Human-readable error message.

required
timeout float

The timeout value in seconds.

required
action str

The IPC action that timed out.

None
label str

The window label involved.

None
**context Any

Additional context.

{}

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.

Parameters:

Name Type Description Default
message str

Human-readable error message.

required
property_name str

The property that caused the error.

required
label str

The window label involved.

None
**context Any

Additional context.

{}

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.

Parameters:

Name Type Description Default
message str

Human-readable error message.

required
exit_code int

The subprocess exit code if available.

None
**context Any

Additional context.

{}

Functions