#[non_exhaustive]pub enum CallError {
Transport(TransportError),
Rpc(i32, String, Option<Value>),
Timeout {
method: String,
budget: Duration,
},
}Expand description
Result of a CDP call: either a transport-level failure, or a structured
JSON-RPC error returned by Chrome. Higher layers (the zendriver crate)
map Rpc into the typed ZendriverError::Cdp variant.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Transport(TransportError)
Connection-level failure (see TransportError).
Rpc(i32, String, Option<Value>)
Chrome answered the command with a structured JSON-RPC error. Carries
the JSON-RPC code, message, and optional data payload.
Timeout
The command was written to the socket but Chrome never answered it within the call’s budget.
Deliberately distinct from both siblings, because the three mean different things and warrant different responses:
CallError::Rpc— Chrome heard the command and said no. The browser is healthy; the command was wrong. Retrying is pointless.CallError::Transport— the connection broke. Chrome may be gone; the handle is unusable.Timeout— the connection is fine and Chrome simply never replied. The browser is wedged, or the operation is slower than the budget allows. Retrying (or raising the budget) can be reasonable.
Carries the method name because that is the diagnostic that makes a
stuck call actionable: “Chrome never answered” is not a bug report,
“Page.navigate went unanswered after 180s” is.
Trait Implementations§
Source§impl Error for CallError
impl Error for CallError
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()