Skip to content
This repository has been archived by the owner on Jan 29, 2023. It is now read-only.

Commit

Permalink
chore: sfError
Browse files Browse the repository at this point in the history
  • Loading branch information
cristiand391 committed Jun 14, 2022
1 parent 99791d5 commit 7b7d1ae
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions templates/src/sfdxCommand.ts.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/
import * as os from 'os';
import { flags, SfdxCommand } from '@salesforce/command';
import { Messages, SfdxError } from '@salesforce/core';
import { Messages, SfError } from '@salesforce/core';
import { AnyJson } from '@salesforce/ts-types';
<%_ const klass = _.upperFirst(_.camelCase(commandName)) _%>

Expand Down Expand Up @@ -64,7 +64,7 @@ export default class <%- klass %> extends SfdxCommand {
// Organization will always return one result, but this is an example of throwing an error
// The output and --json will automatically be handled for you.
if (!result.records || result.records.length <= 0) {
throw new SfdxError(messages.getMessage('errorNoOrgResults', [this.org.getOrgId()]));
throw new SfError(messages.getMessage('errorNoOrgResults', [this.org.getOrgId()]));
}

// Organization always only returns one result
Expand Down

0 comments on commit 7b7d1ae

Please sign in to comment.