Skip to content

Commit

Permalink
fix(@angular/cli): properly show error or ignore on number
Browse files Browse the repository at this point in the history
  • Loading branch information
hansl authored and filipesilva committed Mar 28, 2018
1 parent 0874709 commit 3708935
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions packages/@angular/cli/ember-cli/lib/cli/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,19 @@ class CLI {
const maybeExitCode = await runCommand(environment.commands, environment.cliArgs, logger, context);
return Number.isInteger(maybeExitCode) ? maybeExitCode : 0;
} catch (err) {
if (err) {
const msg = typeof err === 'string' ? err : err.message;
const stack = typeof err === 'string' ? undefined : err.stack;
logger.error(msg);
if (stack) {
logger.error(stack);
}
if (typeof err === 'object') {
logger.fatal(err.message);
logger.fatal(err.stack);
} else if (typeof err === 'string') {
logger.fatal(err);
} else if (typeof err === 'number') {
// Log nothing.
} else {
logger.fatal('An unexpected error occured: ' + JSON.stringify(err));
}

if (this.testing) {
debugger;
throw err;
}
loggingSubscription.unsubscribe();
Expand Down

0 comments on commit 3708935

Please sign in to comment.