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.
Profile
Profile error.
Returned when Firefox profile creation or setup fails.
FirefoxNotFound
Firefox binary not found at path.
Returned when the specified Firefox binary does not exist.
ProcessLaunchFailed
Failed to launch Firefox process.
Returned when Firefox process fails to start.
Connection
WebSocket connection failed.
Returned when WebSocket connection cannot be established.
ConnectionTimeout
Connection timeout waiting for extension.
Returned when extension does not connect within timeout period.
ConnectionClosed
WebSocket connection closed unexpectedly.
Returned when connection is lost during operation.
UnknownCommand
Unknown command method.
Returned when extension receives unrecognized command.
InvalidArgument
Invalid argument in command params.
Returned when command parameters are invalid.
Protocol
Protocol violation or unexpected response.
Returned when protocol message format is invalid.
ElementNotFound
Element not found by selector.
Returned when CSS selector matches no elements.
Fields
StaleElement
Element is stale (no longer in DOM).
Returned when element reference is no longer valid.
FrameNotFound
Frame not found.
Returned when frame ID does not exist.
TabNotFound
Tab not found.
Returned when tab ID does not exist.
ScriptError
JavaScript execution error.
Returned when script execution fails in browser.
Timeout
Operation timeout.
Returned when operation exceeds timeout duration.
Fields
RequestTimeout
Command request timeout.
Returned when WebSocket request times out.
Fields
InterceptNotFound
Network intercept not found.
Returned when intercept ID does not exist.
SessionNotFound
Session not found in connection pool.
Returned when session ID does not exist in the pool.
Io(Error)
IO error.
Json(Error)
JSON serialization error.
WebSocket(Error)
WebSocket error.
ChannelClosed(RecvError)
Channel receive error.
Implementations§
Source§impl Error
impl Error
Sourcepub fn firefox_not_found(path: impl Into<PathBuf>) -> Self
pub fn firefox_not_found(path: impl Into<PathBuf>) -> Self
Creates a Firefox not found error.
Sourcepub fn process_launch_failed(err: IoError) -> Self
pub fn process_launch_failed(err: IoError) -> Self
Creates a process launch failed error.
Sourcepub fn connection(message: impl Into<String>) -> Self
pub fn connection(message: impl Into<String>) -> Self
Creates a connection error.
Sourcepub fn connection_timeout(timeout_ms: u64) -> Self
pub fn connection_timeout(timeout_ms: u64) -> Self
Creates a connection timeout error.
Sourcepub fn invalid_argument(message: impl Into<String>) -> Self
pub fn invalid_argument(message: impl Into<String>) -> Self
Creates an invalid argument error.
Sourcepub fn element_not_found(
selector: impl Into<String>,
tab_id: TabId,
frame_id: FrameId,
) -> Self
pub fn element_not_found( selector: impl Into<String>, tab_id: TabId, frame_id: FrameId, ) -> Self
Creates an element not found error.
Sourcepub fn stale_element(element_id: ElementId) -> Self
pub fn stale_element(element_id: ElementId) -> Self
Creates a stale element error.
Sourcepub fn frame_not_found(frame_id: FrameId) -> Self
pub fn frame_not_found(frame_id: FrameId) -> Self
Creates a frame not found error.
Sourcepub fn tab_not_found(tab_id: TabId) -> Self
pub fn tab_not_found(tab_id: TabId) -> Self
Creates a tab not found error.
Sourcepub fn script_error(message: impl Into<String>) -> Self
pub fn script_error(message: impl Into<String>) -> Self
Creates a script error.
Sourcepub fn request_timeout(request_id: RequestId, timeout_ms: u64) -> Self
pub fn request_timeout(request_id: RequestId, timeout_ms: u64) -> Self
Creates a request timeout error.
Sourcepub fn intercept_not_found(intercept_id: impl Into<String>) -> Self
pub fn intercept_not_found(intercept_id: impl Into<String>) -> Self
Creates an intercept not found error.
Sourcepub fn session_not_found(session_id: SessionId) -> Self
pub fn session_not_found(session_id: SessionId) -> Self
Creates a session not found error.
Source§impl Error
impl Error
Sourcepub fn is_timeout(&self) -> bool
pub fn is_timeout(&self) -> bool
Returns true if this is a timeout error.
Sourcepub fn is_element_error(&self) -> bool
pub fn is_element_error(&self) -> bool
Returns true if this is an element error.
Sourcepub fn is_connection_error(&self) -> bool
pub fn is_connection_error(&self) -> bool
Returns true if this is a connection error.
Sourcepub fn is_recoverable(&self) -> bool
pub fn is_recoverable(&self) -> bool
Returns true if this error is recoverable.
Recoverable errors may succeed on retry.