pub enum BrowserError {
WebSocket {
operation: String,
message: String,
},
ConnectionFailed {
endpoint: String,
reason: String,
},
InvalidResponse {
context: String,
details: String,
},
CommandFailed {
command: String,
reason: String,
},
CdpError {
code: i32,
method: String,
message: String,
},
Timeout {
operation: String,
timeout_secs: u64,
},
Json(Error),
Io(Error),
PageNotFound(String),
TargetNotFound(String),
BrowserNotLaunched(String),
NavigationFailed {
url: String,
reason: String,
},
}Expand description
Errors that can occur during browser automation
Variants§
WebSocket
WebSocket protocol error
Fields
ConnectionFailed
Failed to establish initial connection
InvalidResponse
Invalid or malformed CDP response
CommandFailed
CDP command execution failed
CdpError
CDP protocol error with code
Fields
Timeout
Operation exceeded timeout duration
Fields
Json(Error)
JSON serialization/deserialization error
Io(Error)
IO error from standard library
PageNotFound(String)
Requested page was not found
TargetNotFound(String)
Requested target was not found
BrowserNotLaunched(String)
Browser instance not yet launched
Navigation failed
Implementations§
Source§impl BrowserError
impl BrowserError
Sourcepub fn websocket(
operation: impl Into<String>,
message: impl Into<String>,
) -> Self
pub fn websocket( operation: impl Into<String>, message: impl Into<String>, ) -> Self
Construct a WebSocket error
Sourcepub fn connection_failed(
endpoint: impl Into<String>,
reason: impl Into<String>,
) -> Self
pub fn connection_failed( endpoint: impl Into<String>, reason: impl Into<String>, ) -> Self
Construct a connection-failed error
Sourcepub fn command_failed(
command: impl Into<String>,
reason: impl Into<String>,
) -> Self
pub fn command_failed( command: impl Into<String>, reason: impl Into<String>, ) -> Self
Construct a command-failed error
Sourcepub fn invalid_response(
context: impl Into<String>,
details: impl Into<String>,
) -> Self
pub fn invalid_response( context: impl Into<String>, details: impl Into<String>, ) -> Self
Construct an invalid-response error
Sourcepub fn timeout(operation: impl Into<String>, timeout_secs: u64) -> Self
pub fn timeout(operation: impl Into<String>, timeout_secs: u64) -> Self
Construct a timeout error
Construct a navigation-failed error
Trait Implementations§
Source§impl Debug for BrowserError
impl Debug for BrowserError
Source§impl Display for BrowserError
impl Display for BrowserError
Source§impl Error for BrowserError
impl Error for BrowserError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
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
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<Error> for BrowserError
impl From<Error> for BrowserError
Auto Trait Implementations§
impl Freeze for BrowserError
impl !RefUnwindSafe for BrowserError
impl Send for BrowserError
impl Sync for BrowserError
impl Unpin for BrowserError
impl UnsafeUnpin for BrowserError
impl !UnwindSafe for BrowserError
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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