Errors¶
Every exception the client raises, and the codes and reasons they carry. Guide: Errors.
errors
¶
Exception hierarchy. Driver failures arrive as data (CommandResult.error) and become CommandError; server-level failures arrive as gRPC status codes and are mapped in client.py.
TapError
¶
Bases: Exception
Base class for everything this package raises deliberately.
ServerError
¶
Bases: TapError
The host server rejected or failed a call (unknown connection or device, bad argument,
driver start failure, ...). code is the gRPC status code name; reason is the server's
structured FailureReason, FailureReason.UNSPECIFIED when the failure did not come
from the daemon.
CommandError
¶
Bases: TapError
A driver command's outcome was error. code is an ErrorCode; detail refines it
(e.g. NOT_FOUND/END_REACHED); TRANSPORT_LOST/INDETERMINATE carry the transmission state.
WaitTimeoutError
¶
Bases: TapError
A condition did not hold within its timeout; the message names the device, the
condition and what was observed so a log line alone is diagnosable: reason and
match_count for the waits the device runs (visible, one, gone,
App.await_visible, App.await_screen_stable), last_observation and polls for the
ones the client polls.
reason
¶
reason
Why the device-side condition was still unmet at its last poll; None for client-polled waits.
ErrorCode
¶
Bases: Enum
Why a driver command failed (CommandError.code). UNKNOWN also stands for a code
this client version does not know.
FailureReason
¶
Bases: Enum
The server's structured reason for a failed call (ServerError.reason).
UNSPECIFIED means the failure did not come from the daemon (a transport failure, a proxy,
a cancelled call) or carried a reason this client version does not know.
UNSUPPORTED_API
¶
UNSUPPORTED_API
The device's API level is too low for the call (detail REQUIRES_API_<n>).
DEVICE_SETTING
¶
DEVICE_SETTING
A device setting did not read back as written (or could not be restored).
DEVICE_FILE
¶
DEVICE_FILE
A device file was not written or read as asked: it exists and this device handle did not create it, its directory is missing, it is not a regular file, or it did not read back.
WaitReason
¶
Bases: Enum
Why a device-side wait timed out (WaitTimeoutError.reason).