MCPcopy Create free account
hub / github.com/browserbase/stagehand / catch

Function catch

packages/cli/src/base.ts:18–28  ·  view source on GitHub ↗
(
    err: Error & { exitCode?: number },
  )

Source from the content-addressed store, hash-verified

16 }
17
18 protected override async catch(
19 err: Error & { exitCode?: number },
20 ): Promise<unknown> {
21 if (err instanceof CommandFailure) {
22 recordCommandError("runtime", "COMMAND_FAILURE", err.telemetry);
23 process.stderr.write(`${err.message}\n`);
24 this.exit(err.exitCode);
25 }
26
27 return super.catch(err);
28 }
29}

Callers

nothing calls this directly

Calls 2

recordCommandErrorFunction · 0.85
writeMethod · 0.80

Tested by

no test coverage detected