Skip to content

Commit

Permalink
fix: log errors to stderr
Browse files Browse the repository at this point in the history
  • Loading branch information
mdonnalley committed Mar 23, 2022
1 parent 111e56f commit 9958d8e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/sfCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,9 +241,11 @@ export abstract class SfCommand<T> extends Command {

protected async catch(error: SfCommand.Error): Promise<SfCommand.Error> {
process.exitCode = process.exitCode ?? error.exitCode ?? 1;
this.log(this.formatError(error));
if (this.jsonEnabled()) {
CliUx.ux.styledJSON(this.toErrorJson(error));
} else {
// eslint-disable-next-line no-console
console.error(this.formatError(error));
}
return error;
}
Expand Down

0 comments on commit 9958d8e

Please sign in to comment.