MCPcopy Index your code
hub / github.com/teambit/bit / getExternalErrorMessage

Function getExternalErrorMessage

src/cli/default-error-handler.ts:574–589  ·  view source on GitHub ↗
(externalError: Error | null | undefined)

Source from the content-addressed store, hash-verified

572}
573
574function getExternalErrorMessage(externalError: Error | null | undefined): string {
575 if (!externalError) return '';
576
577 // In case an error is not a real error
578 if (!(externalError instanceof Error)) {
579 return externalError;
580 }
581 // In case it's not a bit error
582 if (externalError.message) {
583 return externalError.message;
584 }
585 const errorDefinition = findErrorDefinition(externalError);
586 const func = getErrorFunc(errorDefinition);
587 const errorMessage = getErrorMessage(externalError, func);
588 return errorMessage;
589}
590
591function getExternalErrorsMessageAndStack(errors: Error[]): string {
592 const result = errors

Calls 3

findErrorDefinitionFunction · 0.85
getErrorFuncFunction · 0.85
getErrorMessageFunction · 0.85

Tested by

no test coverage detected