Files
rea/scripts/lib/browser-process-startup.mts
T

201 lines
6.6 KiB
TypeScript

import type { ChildProcess } from "node:child_process";
import { readFile } from "node:fs/promises";
/** Terminal states that can prevent Chrome from publishing a CDP port. */
export type BrowserStartupFailure =
| "spawn-error"
| "exited"
| "signalled"
| "timeout";
/** Safe diagnostics for a browser process that did not publish a CDP port. */
export class BrowserStartupError extends Error {
readonly _tag = "BrowserStartupError" as const;
readonly failure: BrowserStartupFailure;
readonly executable: string;