Expand description
Shared error types.
Enums§
- Session
Error - Typed errors raised from the page-session layer so callers (and tests) can
pattern-match on the failure category — in particular,
TabHungis the catch-all for the alive-but-unresponsive renderer case that has no protocol event signal. - Target
Kind - 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 contextetc.; we match on message text so we catch both shapes. - 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
codeormessageindicates 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_ target_ gone - Returns true if
messagematches 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.