pub enum CdpError {
WebSocket(Box<Error>),
Http(Error),
Json(Error),
Io(Error),
InvalidUrl(String),
Browser {
code: i64,
message: String,
data: Option<String>,
},
Protocol(String),
Timeout,
NoTarget,
}Expand description
Errors returned by every fallible operation in this crate.
Variants§
WebSocket(Box<Error>)
The CDP WebSocket connection failed or dropped.
Http(Error)
A request to Chrome’s HTTP endpoint (/json/*) failed.
Json(Error)
A CDP payload failed to (de)serialize.
Io(Error)
A filesystem operation (e.g. writing a screenshot) failed.
InvalidUrl(String)
A URL supplied by the caller or returned by Chrome was malformed or missing.
Browser
Chrome rejected a command. code is CDP’s own numeric code (-32601 for a
method the browser does not know, -32602 for bad parameters), message is
what Chrome called the failure, and data is the extra detail some errors
carry. Branch on code rather than on the wording of message.
Fields
Protocol(String)
This crate could not make sense of an otherwise successful exchange: a response of an unexpected shape, a command the transport could not send, or an operation the browser reported as failed through its result rather than through an error frame.
Timeout
A command or event wait exceeded its configured timeout.
NoTarget
No page target was available to connect to (e.g. list_targets returned none).
Trait Implementations§
Source§impl Error for CdpError
impl Error for CdpError
1.30.0 · 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()