Error

Enum Error 

Source
pub enum Error {
Show 23 variants Config { message: String, }, Profile { message: String, }, FirefoxNotFound { path: PathBuf, }, ProcessLaunchFailed { message: String, }, Connection { message: String, }, ConnectionTimeout { timeout_ms: u64, }, ConnectionClosed, UnknownCommand { command: String, }, InvalidArgument { message: String, }, Protocol { message: String, }, ElementNotFound { selector: String, tab_id: TabId, frame_id: FrameId, }, StaleElement { element_id: ElementId, }, FrameNotFound { frame_id: FrameId, }, TabNotFound { tab_id: TabId, }, ScriptError { message: String, }, Timeout { operation: String, timeout_ms: u64, }, RequestTimeout { request_id: RequestId, timeout_ms: u64, }, InterceptNotFound { intercept_id: String, }, SessionNotFound { session_id: SessionId, }, Io(Error), Json(Error), WebSocket(Error), ChannelClosed(RecvError),
}
Expand description

Main error type for the crate.

Each variant includes relevant context for debugging. Error codes match ARCHITECTURE.md Section 6.2.

Variants§

§

Config

Configuration error.

Returned when driver configuration is invalid.

Fields

§message: String

Description of the configuration error.

§

Profile

Profile error.

Returned when Firefox profile creation or setup fails.

Fields

§message: String

Description of the profile error.

§

FirefoxNotFound

Firefox binary not found at path.

Returned when the specified Firefox binary does not exist.

Fields

§path: PathBuf

Path where Firefox was expected.

§

ProcessLaunchFailed

Failed to launch Firefox process.

Returned when Firefox process fails to start.

Fields

§message: String

Description of the launch failure.

§

Connection

WebSocket connection failed.

Returned when WebSocket connection cannot be established.

Fields

§message: String

Description of the connection error.

§

ConnectionTimeout

Connection timeout waiting for extension.

Returned when extension does not connect within timeout period.

Fields

§timeout_ms: u64

Milliseconds waited before timeout.

§

ConnectionClosed

WebSocket connection closed unexpectedly.

Returned when connection is lost during operation.

§

UnknownCommand

Unknown command method.

Returned when extension receives unrecognized command.

Fields

§command: String

The unrecognized command method.

§

InvalidArgument

Invalid argument in command params.

Returned when command parameters are invalid.

Fields

§message: String

Description of the invalid argument.

§

Protocol

Protocol violation or unexpected response.

Returned when protocol message format is invalid.

Fields

§message: String

Description of the protocol violation.

§

ElementNotFound

Element not found by selector.

Returned when CSS selector matches no elements.

Fields

§selector: String

CSS selector used.

§tab_id: TabId

Tab where search was performed.

§frame_id: FrameId

Frame where search was performed.

§

StaleElement

Element is stale (no longer in DOM).

Returned when element reference is no longer valid.

Fields

§element_id: ElementId

The stale element’s ID.

§

FrameNotFound

Frame not found.

Returned when frame ID does not exist.

Fields

§frame_id: FrameId

The missing frame ID.

§

TabNotFound

Tab not found.

Returned when tab ID does not exist.

Fields

§tab_id: TabId

The missing tab ID.

§

ScriptError

JavaScript execution error.

Returned when script execution fails in browser.

Fields

§message: String

Error message from script execution.

§

Timeout

Operation timeout.

Returned when operation exceeds timeout duration.

Fields

§operation: String

Description of the operation that timed out.

§timeout_ms: u64

Milliseconds waited before timeout.

§

RequestTimeout

Command request timeout.

Returned when WebSocket request times out.

Fields

§request_id: RequestId

The request ID that timed out.

§timeout_ms: u64

Milliseconds waited before timeout.

§

InterceptNotFound

Network intercept not found.

Returned when intercept ID does not exist.

Fields

§intercept_id: String

The missing intercept ID.

§

SessionNotFound

Session not found in connection pool.

Returned when session ID does not exist in the pool.

Fields

§session_id: SessionId

The missing session ID.

§

Io(Error)

IO error.

§

Json(Error)

JSON serialization error.

§

WebSocket(Error)

WebSocket error.

§

ChannelClosed(RecvError)

Channel receive error.

Implementations§

Source§

impl Error

Source

pub fn config(message: impl Into<String>) -> Self

Creates a configuration error.

Source

pub fn profile(message: impl Into<String>) -> Self

Creates a profile error.

Source

pub fn firefox_not_found(path: impl Into<PathBuf>) -> Self

Creates a Firefox not found error.

Source

pub fn process_launch_failed(err: IoError) -> Self

Creates a process launch failed error.

Source

pub fn connection(message: impl Into<String>) -> Self

Creates a connection error.

Source

pub fn connection_timeout(timeout_ms: u64) -> Self

Creates a connection timeout error.

Source

pub fn protocol(message: impl Into<String>) -> Self

Creates a protocol error.

Source

pub fn invalid_argument(message: impl Into<String>) -> Self

Creates an invalid argument error.

Source

pub fn element_not_found( selector: impl Into<String>, tab_id: TabId, frame_id: FrameId, ) -> Self

Creates an element not found error.

Source

pub fn stale_element(element_id: ElementId) -> Self

Creates a stale element error.

Source

pub fn frame_not_found(frame_id: FrameId) -> Self

Creates a frame not found error.

Source

pub fn tab_not_found(tab_id: TabId) -> Self

Creates a tab not found error.

Source

pub fn script_error(message: impl Into<String>) -> Self

Creates a script error.

Source

pub fn timeout(operation: impl Into<String>, timeout_ms: u64) -> Self

Creates a timeout error.

Source

pub fn request_timeout(request_id: RequestId, timeout_ms: u64) -> Self

Creates a request timeout error.

Source

pub fn intercept_not_found(intercept_id: impl Into<String>) -> Self

Creates an intercept not found error.

Source

pub fn session_not_found(session_id: SessionId) -> Self

Creates a session not found error.

Source§

impl Error

Source

pub fn is_timeout(&self) -> bool

Returns true if this is a timeout error.

Source

pub fn is_element_error(&self) -> bool

Returns true if this is an element error.

Source

pub fn is_connection_error(&self) -> bool

Returns true if this is a connection error.

Source

pub fn is_recoverable(&self) -> bool

Returns true if this error is recoverable.

Recoverable errors may succeed on retry.

Trait Implementations§

Source§

impl Debug for Error

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for Error

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for Error

Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<Error> for Error

Source§

fn from(source: IoError) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for Error

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for Error

Source§

fn from(source: WsError) -> Self

Converts to this type from the input type.
Source§

impl From<RecvError> for Error

Source§

fn from(source: RecvError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl Freeze for Error

§

impl !RefUnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl !UnwindSafe for Error

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more