Skip to content

Commit

Permalink
feat: Error messages are no longer prefixed by the command (#1002)
Browse files Browse the repository at this point in the history
  • Loading branch information
tsl143 authored and kumar303 committed Aug 23, 2017
1 parent 86492db commit b0250ed
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/program.js
Expand Up @@ -148,16 +148,17 @@ export class Program {
await runCommand(argv, {shouldExitProgram});

} catch (error) {
const prefix = cmd ? `${cmd}: ` : '';
if (!(error instanceof UsageError) || argv.verbose) {
log.error(`\n${prefix}${error.stack}\n`);
log.error(`\n${error.stack}\n`);
} else {
log.error(`\n${prefix}${error}\n`);
log.error(`\n${error}\n`);
}
if (error.code) {
log.error(`${prefix}Error code: ${error.code}\n`);
log.error(`Error code: ${error.code}\n`);
}

log.debug(`Command executed: ${cmd}`);

if (this.shouldExitProgram) {
systemProcess.exit(1);
} else {
Expand Down

0 comments on commit b0250ed

Please sign in to comment.