MCPcopy Index your code
hub / github.com/ionic-team/capacitor / wrapAction

Function wrapAction

cli/src/util/cli.ts:10–23  ·  view source on GitHub ↗
(action: CommanderAction)

Source from the content-addressed store, hash-verified

8export type CommanderAction = (...args: any[]) => void | Promise<void>;
9
10export function wrapAction(action: CommanderAction): CommanderAction {
11 return async (...args: any[]) => {
12 try {
13 await action(...args);
14 } catch (e) {
15 if (isFatal(e)) {
16 process.exitCode = e.exitCode;
17 logger.error(e.message);
18 } else {
19 throw e;
20 }
21 }
22 };
23}

Callers 1

runProgramFunction · 0.90

Calls 2

isFatalFunction · 0.90
errorMethod · 0.80

Tested by

no test coverage detected