#[non_exhaustive]pub enum FailureCode {
ElementNotFound,
NotVisible,
NotEnabled,
Ambiguous,
Timeout,
AssertionFailed,
AppNotRunning,
SimulatorNotBooted,
TapMissed,
CoordinateSpaceMismatch,
DriverError,
CaptureBackpressure,
}Expand description
All failure codes smix surfaces back to the SDK / MCP / CLI (SCREAMING_SNAKE_CASE wire).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
ElementNotFound
Selector matched zero elements in the visible tree.
NotVisible
Element matched but failed the visibility filter.
NotEnabled
Element matched but enabled = false.
Ambiguous
Selector matched multiple elements (when uniqueness was required).
Timeout
Operation exceeded the implicit-wait budget.
AssertionFailed
expect assertion (e.g. toHaveText) did not hold.
AppNotRunning
Target app exited or never launched.
SimulatorNotBooted
Simulator device is not booted.
TapMissed
The touch was synthesised, and it did not land inside the element the selector matched.
Distinct from ElementNotFound because the two send a reader
somewhere different: not-found means fix the selector, missed
means the element was there and the touch went elsewhere — a
stale frame, or something moved between the tree fetch and the
tap.
CoordinateSpaceMismatch
The screen is described in one coordinate space and the touch would be delivered in another, so no aim can land where the tree says the element is.
Distinct from TapMissed, and the distinction is the whole
point: a miss says the element was there and the touch went
elsewhere, which invites another attempt with a better point.
There is no better point here — whatever is passed gets
recomputed against the app’s frame and then read against the
device’s. Retrying is the trap, and the consumer who found this
spent an afternoon in it.
DriverError
Catch-all for runner / driver / IO failures.
CaptureBackpressure
The device’s capture path is under load and refusing frames for a stated window — the screenshot pacer’s circuit is open.
Separate from Self::DriverError because the two want opposite
responses and only one of them is a defect. A driver error means
something is broken; this means “not now, try again shortly”, and
a caller with time left can simply keep waiting. It arrived as a
DriverError until 7.1, which is how a consumer’s release gate
met it: FAIL [DRIVER_ERROR] from waitForAnimationToEnd, a
verb whose entire meaning is to wait.
Implementations§
Source§impl FailureCode
impl FailureCode
Sourcepub const ALL: &'static [FailureCode]
pub const ALL: &'static [FailureCode]
Every code, once.
Exported because the alternative is a second hand-written copy,
and there was one: tests/sdk_failure_code_parity.rs kept its
own all_variants() list, and every assertion in that file —
the three SDK declarations and the errors guide — is derived
from it. Its docstring said adding a variant would stop the file
compiling. That stopped being true when the exhaustiveness guard
moved in here, because #[non_exhaustive] makes an outside
match accept anything; adding CaptureBackpressure in 7.1 left
all seven of those assertions green while no SDK declared it.
Self::ALL is the one list. The exhaustive match in
the_vocabulary_is_pinned guards it from in here, where
non_exhaustive cannot weaken the match, and everything else
reads it rather than repeating it.
Trait Implementations§
Source§impl Clone for FailureCode
impl Clone for FailureCode
Source§fn clone(&self) -> FailureCode
fn clone(&self) -> FailureCode
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more