MCPcopy
hub / github.com/teambit/bit / handleUnhandledRejection

Function handleUnhandledRejection

src/cli/command-runner.ts:105–113  ·  view source on GitHub ↗
(err: Error | null | undefined | {})

Source from the content-addressed store, hash-verified

103}
104
105export function handleUnhandledRejection(err: Error | null | undefined | {}) {
106 // eslint-disable-next-line no-console
107 console.error('** unhandled rejection found, please make sure the promise is resolved/rejected correctly! **');
108 if (err instanceof Error) {
109 return handleErrorAndExit(err, process.argv[2]);
110 }
111 console.error(err); // eslint-disable-line
112 return handleErrorAndExit(new Error(`unhandledRejections found. err ${err}`), process.argv[2]);
113}
114
115export function logErrAndExit(err: Error | string, commandName: string) {
116 if (!err) throw new Error(`logErrAndExit expects to get either an Error or a string, got nothing`);

Callers 1

app.tsFile · 0.90

Calls 2

handleErrorAndExitFunction · 0.85
errorMethod · 0.65

Tested by

no test coverage detected