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

Function getErrMsg

src/cli/default-error-handler.ts:633–644  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

631export default (err: Error): { message: string; error: Error } => {
632 const errorDefinition = findErrorDefinition(err);
633 const getErrMsg = (): string => {
634 if (err instanceof PaperError) {
635 return err.report();
636 }
637 if (!errorDefinition) {
638 return handleNonBitCustomErrors(err);
639 }
640 const func = getErrorFunc(errorDefinition);
641 const errorMessage = getErrorMessage(err, func) || 'unknown error';
642 err.message = errorMessage;
643 return errorMessage;
644 };
645 sendToAnalyticsAndSentry(err);
646 const errorMessage = getErrMsg();
647 logger.error(`user gets the following error: ${errorMessage}`);

Callers 1

Calls 4

handleNonBitCustomErrorsFunction · 0.85
getErrorFuncFunction · 0.85
getErrorMessageFunction · 0.85
reportMethod · 0.65

Tested by

no test coverage detected