Skip to main content

Module errors

Module errors 

Source
Expand description

Shared error types.

Enums§

SessionError
Typed errors raised from the page-session layer so callers (and tests) can pattern-match on the failure category — in particular, TabHung is the catch-all for the alive-but-unresponsive renderer case that has no protocol event signal.
TargetKind
Which protocol surfaced a TargetGone. Useful for diagnostics; the recovery path treats both kinds identically.

Constants§

BIDI_TARGET_GONE_NEEDLES
Substrings that indicate a BiDi context/frame/session is gone. BiDi also surfaces context-gone via the dedicated error codes no such frame / no such context etc.; we match on message text so we catch both shapes.
CDP_NODE_GONE_NEEDLES
Substrings in CDP DOM.* error messages that mean the referenced backendDOMNodeId no longer belongs to a document.
CDP_TARGET_GONE_NEEDLES
Substrings that, when found in a CDP error message, indicate the target/session referenced by the call no longer exists. Centralised so the client-layer classifier and the recovery-wrapper fallback agree.

Functions§

is_bidi_target_gone
Returns true if code or message indicates a BiDi context is gone. BiDi codes are stable per spec (no such frame, etc.), but we also scan the message in case the code is generic.
is_cdp_node_gone
is_cdp_target_gone
Returns true if message matches any CDP “target gone” indicator.
is_recoverable_tab_failure
Single shared predicate for “the tab the op targeted is dead; one recover-and-retry round is appropriate.” Used by with_scratch_recovery, with_named_tab_recovery, and the origin-bound evaluate helper. Keeping these in one place avoids the call sites drifting apart on what counts as recoverable.