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

Function handleErrorAndExit

src/cli/command-runner.ts:96–103  ·  view source on GitHub ↗
(err: Error, commandName: string, shouldSerialize = false)

Source from the content-addressed store, hash-verified

94}
95
96export function handleErrorAndExit(err: Error, commandName: string, shouldSerialize = false) {
97 loader.off();
98 logger.error(`got an error from command ${commandName}: ${err}`);
99 logger.error(err.stack || '<no error stack was found>');
100 const { message, error } = defaultHandleError(err);
101 if (shouldSerialize) return serializeErrAndExit(error, commandName);
102 return logErrAndExit(message, commandName);
103}
104
105export function handleUnhandledRejection(err: Error | null | undefined | {}) {
106 // eslint-disable-next-line no-console

Callers 3

initAppFunction · 0.90
runCommandMethod · 0.85
handleUnhandledRejectionFunction · 0.85

Calls 3

serializeErrAndExitFunction · 0.85
logErrAndExitFunction · 0.85
errorMethod · 0.65

Tested by

no test coverage detected