pub enum Error {
ElementNotFound {
xpath: String,
},
AmbiguousSelector {
xpath: String,
count: usize,
},
InvalidSelector {
xpath: String,
reason: String,
},
ElementStale {
xpath: String,
bus: String,
path: String,
},
Atspi {
message: String,
source: Option<Box<dyn Error + Send + Sync + 'static>>,
},
Zbus(Error),
Io(Error),
Timeout(String),
Cancelled,
Process {
message: String,
source: Option<Box<dyn Error + Send + Sync + 'static>>,
},
Screenshot {
message: String,
source: Option<Box<dyn Error + Send + Sync + 'static>>,
},
}Expand description
Errors that can occur during a waydriver session.
Variants§
ElementNotFound
AmbiguousSelector
InvalidSelector
ElementStale
Atspi
AT-SPI introspection / action failure.
message carries human-readable context ("<operation>: <details>");
source carries the typed underlying error (commonly zbus::Error)
when one exists, so callers can downcast via
std::error::Error::source. Construct via Error::atspi /
Error::atspi_with.
Zbus(Error)
Io(Error)
Timeout(String)
Cancelled
The session’s cancellation token was triggered while this
operation was in flight. Typically means kill_session was
called on an MCP session with in-flight tool calls — the tool
bails out of any auto-wait loop so kill can proceed without
waiting for the natural timeout.
Process
Subprocess / IPC / mutex-poisoning failure. See Error::Atspi for
the field semantics; construct via Error::process /
Error::process_with.
Screenshot
Screenshot / video-capture failure. See Error::Atspi for the
field semantics; construct via Error::screenshot /
Error::screenshot_with.
Implementations§
Source§impl Error
impl Error
Sourcepub fn atspi(message: impl Into<String>) -> Self
pub fn atspi(message: impl Into<String>) -> Self
AT-SPI failure with a free-form message and no underlying source.
Sourcepub fn atspi_with<E>(operation: impl Display, source: E) -> Self
pub fn atspi_with<E>(operation: impl Display, source: E) -> Self
AT-SPI failure caused by an underlying error. The Display of
source is appended to operation so the rendered message stays
"AT-SPI: <operation>: <source>", and the typed source is preserved
for std::error::Error::source.
Sourcepub fn process(message: impl Into<String>) -> Self
pub fn process(message: impl Into<String>) -> Self
Process / IPC failure with a free-form message and no source.
Sourcepub fn process_with<E>(operation: impl Display, source: E) -> Self
pub fn process_with<E>(operation: impl Display, source: E) -> Self
Process / IPC failure caused by an underlying error. See
Error::atspi_with for the message-formatting rules.
Sourcepub fn screenshot(message: impl Into<String>) -> Self
pub fn screenshot(message: impl Into<String>) -> Self
Screenshot / capture failure with a free-form message and no source.
Sourcepub fn screenshot_with<E>(operation: impl Display, source: E) -> Self
pub fn screenshot_with<E>(operation: impl Display, source: E) -> Self
Screenshot / capture failure caused by an underlying error. See
Error::atspi_with for the message-formatting rules.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for Error
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
impl !UnwindSafe for Error
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more