Skip to content

Commit

Permalink
fix: emit sfCommandError event (#240)
Browse files Browse the repository at this point in the history
* fix: emit sfCommandError event

* fix: store parsed flags on class

* chore: remove uneccessary canges

---------

Co-authored-by: Cristian Dominguez <cdominguez@salesforce.com>
  • Loading branch information
mdonnalley and cristiand391 committed Apr 24, 2023
1 parent 6fcabb7 commit ac385c0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/sfCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,10 @@ export abstract class SfCommand<T> extends Command {
// @ts-expect-error because skipOclifErrorHandling is not on SfError
err.skipOclifErrorHandling = true;

// Emit an event for plugin-telemetry prerun hook to pick up.
// @ts-expect-error because TS is strict about the events that can be emitted on process.
process.emit('sfCommandError', err);

throw err;
}

Expand Down

0 comments on commit ac385c0

Please sign in to comment.