all repos — sz-chrome-remote-cdp @ 6d300099a86cfdb92b7869dc2b4f33094554b24c

pi-browser-harness, patched to drive a Chrome on another host over CDP, with castle_cdp_search web search

src/cdp/errors.ts (view raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
export type CdpErrorKind =
  | "transport_closed"
  | "timeout"
  | "session_not_found"
  | "remote_error"
  | "discovery_failed"
  | "invalid_response";

export type CdpError = {
  readonly kind: CdpErrorKind;
  readonly message: string;
  readonly method?: string;
};

export const cdpError = (
  kind: CdpErrorKind,
  message: string,
  method?: string,
): CdpError => ({ kind, message, ...(method !== undefined ? { method } : {}) });