diff --git a/src/sfCommand.ts b/src/sfCommand.ts index 828f89e5..37215e44 100644 --- a/src/sfCommand.ts +++ b/src/sfCommand.ts @@ -241,9 +241,11 @@ export abstract class SfCommand extends Command { protected async catch(error: SfCommand.Error): Promise { 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; }