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

Function handleNonBitCustomErrors

src/cli/default-error-handler.ts:618–629  ·  view source on GitHub ↗
(err: Error)

Source from the content-addressed store, hash-verified

616}
617
618function handleNonBitCustomErrors(err: Error): string {
619 // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
620 if (err.code === 'EACCES') {
621 // see #1774
622 return chalk.red(
623 // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
624 `error: you do not have permissions to access '${err.path}', were you running bit, npm or git as root?`
625 );
626 }
627 // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
628 return chalk.red(err.message || err);
629}
630
631export default (err: Error): { message: string; error: Error } => {
632 const errorDefinition = findErrorDefinition(err);

Callers 1

getErrMsgFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected