Skip to content

Commit

Permalink
fix: handle errors emitted from SfCommand (#432)
Browse files Browse the repository at this point in the history
* fix: handle errors from SfCommand

* chore: update snapshot

* fix: add orgType and apiVersion to sfCommandError handler

* chore: linting

* fix: avoid race conditions

* chore: remove unecessary tests

* chore: dedup lockfile

---------

Co-authored-by: Cristian Dominguez <[email protected]>
  • Loading branch information
mdonnalley and cristiand391 authored Apr 24, 2023
1 parent b281db8 commit def30ff
Show file tree
Hide file tree
Showing 15 changed files with 267 additions and 402 deletions.
137 changes: 28 additions & 109 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,240 +1,159 @@
## [2.1.5](https://github.com/salesforcecli/plugin-telemetry/compare/2.1.4...2.1.5) (2023-04-22)


### Bug Fixes

* **deps:** bump @oclif/core from 2.8.0 to 2.8.2 ([f8d0888](https://github.com/salesforcecli/plugin-telemetry/commit/f8d0888ecd2536ad8bbe28ca13dcfd1555a04179))


- **deps:** bump @oclif/core from 2.8.0 to 2.8.2 ([f8d0888](https://github.com/salesforcecli/plugin-telemetry/commit/f8d0888ecd2536ad8bbe28ca13dcfd1555a04179))

## [2.1.4](https://github.com/salesforcecli/plugin-telemetry/compare/2.1.3...2.1.4) (2023-04-15)


### Bug Fixes

* **deps:** bump @salesforce/core from 3.33.6 to 3.34.6 ([dbe057d](https://github.com/salesforcecli/plugin-telemetry/commit/dbe057d5a65a38b1d7980f59b9a63473f74513b4))


- **deps:** bump @salesforce/core from 3.33.6 to 3.34.6 ([dbe057d](https://github.com/salesforcecli/plugin-telemetry/commit/dbe057d5a65a38b1d7980f59b9a63473f74513b4))

## [2.1.3](https://github.com/salesforcecli/plugin-telemetry/compare/2.1.2...2.1.3) (2023-03-07)


### Bug Fixes

* collect perf results on failed command executions ([#431](https://github.com/salesforcecli/plugin-telemetry/issues/431)) ([c829946](https://github.com/salesforcecli/plugin-telemetry/commit/c8299467c2c25e52ff4ec9637ec76997d47ba1bc))


- collect perf results on failed command executions ([#431](https://github.com/salesforcecli/plugin-telemetry/issues/431)) ([c829946](https://github.com/salesforcecli/plugin-telemetry/commit/c8299467c2c25e52ff4ec9637ec76997d47ba1bc))

## [2.1.2](https://github.com/salesforcecli/plugin-telemetry/compare/2.1.1...2.1.2) (2023-03-06)



## [2.1.1](https://github.com/salesforcecli/plugin-telemetry/compare/2.1.0...2.1.1) (2023-02-04)


### Bug Fixes

* **deps:** bump http-cache-semantics from 4.1.0 to 4.1.1 ([f27ac5d](https://github.com/salesforcecli/plugin-telemetry/commit/f27ac5df648a18fa56e272968b1d9d7fd3fcf1b2))


- **deps:** bump http-cache-semantics from 4.1.0 to 4.1.1 ([f27ac5d](https://github.com/salesforcecli/plugin-telemetry/commit/f27ac5df648a18fa56e272968b1d9d7fd3fcf1b2))

# [2.1.0](https://github.com/salesforcecli/plugin-telemetry/compare/2.0.7...2.1.0) (2023-01-30)


### Features

* update to oclif/core v2 ([#415](https://github.com/salesforcecli/plugin-telemetry/issues/415)) ([d92b44a](https://github.com/salesforcecli/plugin-telemetry/commit/d92b44a57c27a3d709084eebf25e5f6f3b0f11c3))


- update to oclif/core v2 ([#415](https://github.com/salesforcecli/plugin-telemetry/issues/415)) ([d92b44a](https://github.com/salesforcecli/plugin-telemetry/commit/d92b44a57c27a3d709084eebf25e5f6f3b0f11c3))

## [2.0.7](https://github.com/salesforcecli/plugin-telemetry/compare/2.0.6...2.0.7) (2023-01-26)


### Bug Fixes

* **deps:** bump json5 from 1.0.1 to 1.0.2 ([4ac4619](https://github.com/salesforcecli/plugin-telemetry/commit/4ac46193edecbf84a8f53e3d6417dc0681692a69))


- **deps:** bump json5 from 1.0.1 to 1.0.2 ([4ac4619](https://github.com/salesforcecli/plugin-telemetry/commit/4ac46193edecbf84a8f53e3d6417dc0681692a69))

## [2.0.6](https://github.com/salesforcecli/plugin-telemetry/compare/2.0.5...2.0.6) (2023-01-25)


### Bug Fixes

* typo in CI detection ([#408](https://github.com/salesforcecli/plugin-telemetry/issues/408)) ([0f7a3c8](https://github.com/salesforcecli/plugin-telemetry/commit/0f7a3c89b9adb115cb13354093a354565e96077e))


- typo in CI detection ([#408](https://github.com/salesforcecli/plugin-telemetry/issues/408)) ([0f7a3c8](https://github.com/salesforcecli/plugin-telemetry/commit/0f7a3c89b9adb115cb13354093a354565e96077e))

## [2.0.5](https://github.com/salesforcecli/plugin-telemetry/compare/2.0.4...2.0.5) (2022-11-26)


### Bug Fixes

* **deps:** bump @salesforce/core from 3.31.19 to 3.32.2 ([eeab265](https://github.com/salesforcecli/plugin-telemetry/commit/eeab2653f3d08673d45baac9f61474cad5bef327))


- **deps:** bump @salesforce/core from 3.31.19 to 3.32.2 ([eeab265](https://github.com/salesforcecli/plugin-telemetry/commit/eeab2653f3d08673d45baac9f61474cad5bef327))

## [2.0.4](https://github.com/salesforcecli/plugin-telemetry/compare/2.0.3...2.0.4) (2022-11-12)


### Bug Fixes

* **deps:** bump @salesforce/core from 3.31.17 to 3.31.19 ([d6abbbf](https://github.com/salesforcecli/plugin-telemetry/commit/d6abbbf122e435760b5e969910e7848bec70a09d))


- **deps:** bump @salesforce/core from 3.31.17 to 3.31.19 ([d6abbbf](https://github.com/salesforcecli/plugin-telemetry/commit/d6abbbf122e435760b5e969910e7848bec70a09d))

## [2.0.3](https://github.com/salesforcecli/plugin-telemetry/compare/2.0.2...2.0.3) (2022-11-05)


### Bug Fixes

* **deps:** bump @salesforce/telemetry from 3.2.1 to 3.2.5 ([e39a381](https://github.com/salesforcecli/plugin-telemetry/commit/e39a381ed8cd06e8453393e1bdd3be38ca0e3bcf))


- **deps:** bump @salesforce/telemetry from 3.2.1 to 3.2.5 ([e39a381](https://github.com/salesforcecli/plugin-telemetry/commit/e39a381ed8cd06e8453393e1bdd3be38ca0e3bcf))

## [2.0.2](https://github.com/salesforcecli/plugin-telemetry/compare/2.0.1...2.0.2) (2022-09-25)


### Bug Fixes

* **deps:** bump @salesforce/core from 3.30.3 to 3.30.8 ([40cb5a5](https://github.com/salesforcecli/plugin-telemetry/commit/40cb5a5a7b5a08011537192bb9ee66c1e89448a2))


- **deps:** bump @salesforce/core from 3.30.3 to 3.30.8 ([40cb5a5](https://github.com/salesforcecli/plugin-telemetry/commit/40cb5a5a7b5a08011537192bb9ee66c1e89448a2))

## [2.0.1](https://github.com/salesforcecli/plugin-telemetry/compare/v2.0.0...2.0.1) (2022-09-23)


### Bug Fixes

* **deps:** bump @salesforce/core from 3.26.2 to 3.30.3 ([690062c](https://github.com/salesforcecli/plugin-telemetry/commit/690062c204aad2149793a54ac5aac264a414cfb6))


- **deps:** bump @salesforce/core from 3.26.2 to 3.30.3 ([690062c](https://github.com/salesforcecli/plugin-telemetry/commit/690062c204aad2149793a54ac5aac264a414cfb6))

# [2.0.0](https://github.com/salesforcecli/plugin-telemetry/compare/v1.4.0...v2.0.0) (2022-05-06)


### Bug Fixes

* bump to core 3, remove command dep ([9953823](https://github.com/salesforcecli/plugin-telemetry/commit/99538230cdcd844053bf61aec03ae898583e0574))
* use oclif/core interfaces ([954fb17](https://github.com/salesforcecli/plugin-telemetry/commit/954fb179e679372fbea69d8ce8a4a638f99a066e))


- bump to core 3, remove command dep ([9953823](https://github.com/salesforcecli/plugin-telemetry/commit/99538230cdcd844053bf61aec03ae898583e0574))
- use oclif/core interfaces ([954fb17](https://github.com/salesforcecli/plugin-telemetry/commit/954fb179e679372fbea69d8ce8a4a638f99a066e))

# [1.4.0](https://github.com/salesforcecli/plugin-telemetry/compare/v1.3.0...v1.4.0) (2021-12-01)


### Features

* bump command, core, and telemetry deps ([7e643bf](https://github.com/salesforcecli/plugin-telemetry/commit/7e643bf4adb62650b688713329b234dfaf96f719))


- bump command, core, and telemetry deps ([7e643bf](https://github.com/salesforcecli/plugin-telemetry/commit/7e643bf4adb62650b688713329b234dfaf96f719))

# [1.3.0](https://github.com/salesforcecli/plugin-telemetry/compare/v1.2.8...v1.3.0) (2021-11-17)


### Bug Fixes

* set event type ([120bbf1](https://github.com/salesforcecli/plugin-telemetry/commit/120bbf1b40377dacf61186ae27a413a37e8441fc))

- set event type ([120bbf1](https://github.com/salesforcecli/plugin-telemetry/commit/120bbf1b40377dacf61186ae27a413a37e8441fc))

### Features

* forwards telemetry ([292a296](https://github.com/salesforcecli/plugin-telemetry/commit/292a296ced7537c06ffebb3e567d4495f0022118))


- forwards telemetry ([292a296](https://github.com/salesforcecli/plugin-telemetry/commit/292a296ced7537c06ffebb3e567d4495f0022118))

## [1.2.8](https://github.com/salesforcecli/plugin-telemetry/compare/v1.2.7...v1.2.8) (2021-10-12)



## [1.2.7](https://github.com/salesforcecli/plugin-telemetry/compare/v1.2.6...v1.2.7) (2021-10-08)


### Bug Fixes

* add executable to prerun events ([#209](https://github.com/salesforcecli/plugin-telemetry/issues/209)) ([50248fe](https://github.com/salesforcecli/plugin-telemetry/commit/50248fe2da68d80fb1ab613f3ece88e2ca647bf7))


- add executable to prerun events ([#209](https://github.com/salesforcecli/plugin-telemetry/issues/209)) ([50248fe](https://github.com/salesforcecli/plugin-telemetry/commit/50248fe2da68d80fb1ab613f3ece88e2ca647bf7))

## [1.2.6](https://github.com/salesforcecli/plugin-telemetry/compare/v1.2.5...v1.2.6) (2021-10-07)


### Bug Fixes

* leave org as undefined when trying to determine its type ([39954df](https://github.com/salesforcecli/plugin-telemetry/commit/39954df294a8edad9539607e03ee20ee4f4f2f0a))


- leave org as undefined when trying to determine its type ([39954df](https://github.com/salesforcecli/plugin-telemetry/commit/39954df294a8edad9539607e03ee20ee4f4f2f0a))

## [1.2.5](https://github.com/salesforcecli/plugin-telemetry/compare/v1.2.4...v1.2.5) (2021-10-06)


### Bug Fixes

* fix yarn install for CI ([cc8e2ee](https://github.com/salesforcecli/plugin-telemetry/commit/cc8e2eea22993c57bafb40c6309f8d1d8aa262cf))


- fix yarn install for CI ([cc8e2ee](https://github.com/salesforcecli/plugin-telemetry/commit/cc8e2eea22993c57bafb40c6309f8d1d8aa262cf))

## [1.2.4](https://github.com/salesforcecli/plugin-telemetry/compare/v1.2.3...v1.2.4) (2021-09-14)


### Bug Fixes

* bump @salesfoce/command to v4 ([#192](https://github.com/salesforcecli/plugin-telemetry/issues/192)) ([ba63c95](https://github.com/salesforcecli/plugin-telemetry/commit/ba63c959c7942c09e6c7da47ce8a94568fa9898a))


- bump @salesfoce/command to v4 ([#192](https://github.com/salesforcecli/plugin-telemetry/issues/192)) ([ba63c95](https://github.com/salesforcecli/plugin-telemetry/commit/ba63c959c7942c09e6c7da47ce8a94568fa9898a))

## [1.2.3](https://github.com/salesforcecli/plugin-telemetry/compare/v1.2.2...v1.2.3) (2021-07-09)


### Bug Fixes

* add executable to command execution ([#161](https://github.com/salesforcecli/plugin-telemetry/issues/161)) ([58a4206](https://github.com/salesforcecli/plugin-telemetry/commit/58a4206fc6537e26dc2e390100ffa3b3fba52635))


- add executable to command execution ([#161](https://github.com/salesforcecli/plugin-telemetry/issues/161)) ([58a4206](https://github.com/salesforcecli/plugin-telemetry/commit/58a4206fc6537e26dc2e390100ffa3b3fba52635))

## [1.2.2](https://github.com/salesforcecli/plugin-telemetry/compare/v1.2.1...v1.2.2) (2021-06-10)


### Bug Fixes

* dependency bumps ([150bf86](https://github.com/salesforcecli/plugin-telemetry/commit/150bf86ff3d24d5af222ba0fc15a12b58f83ec26))


- dependency bumps ([150bf86](https://github.com/salesforcecli/plugin-telemetry/commit/150bf86ff3d24d5af222ba0fc15a12b58f83ec26))

## [1.2.1](https://github.com/salesforcecli/plugin-telemetry/compare/v1.2.0...v1.2.1) (2021-05-10)



# [1.2.0](https://github.com/salesforcecli/plugin-telemetry/compare/v1.1.2...v1.2.0) (2021-04-27)


### Features

* add nut test ([b515bf9](https://github.com/salesforcecli/plugin-telemetry/commit/b515bf9da73f8b8a87a94653fe64b3b1fbbdb8f2))


- add nut test ([b515bf9](https://github.com/salesforcecli/plugin-telemetry/commit/b515bf9da73f8b8a87a94653fe64b3b1fbbdb8f2))

## [1.1.2](https://github.com/salesforcecli/plugin-telemetry/compare/v1.1.1...v1.1.2) (2021-04-06)


### Bug Fixes

* leif .yml merge [skip-validate-pr] ([6f48246](https://github.com/salesforcecli/plugin-telemetry/commit/6f482462d67c0658ea6045581a0ace92fcb96b71))


- leif .yml merge [skip-validate-pr] ([6f48246](https://github.com/salesforcecli/plugin-telemetry/commit/6f482462d67c0658ea6045581a0ace92fcb96b71))

## [1.1.1](https://github.com/salesforcecli/plugin-telemetry/compare/v1.1.0...v1.1.1) (2021-02-04)


### Bug Fixes

* inclusive language cleanup ([37c1746](https://github.com/salesforcecli/plugin-telemetry/commit/37c1746c0d694c10311a2180b7833e401be6726f))
* update ci list ([1612f29](https://github.com/salesforcecli/plugin-telemetry/commit/1612f29a3beaee8b68064dab59f7d8b6dfc6043d))

- inclusive language cleanup ([37c1746](https://github.com/salesforcecli/plugin-telemetry/commit/37c1746c0d694c10311a2180b7833e401be6726f))
- update ci list ([1612f29](https://github.com/salesforcecli/plugin-telemetry/commit/1612f29a3beaee8b68064dab59f7d8b6dfc6043d))

### Features

* add telemetry event to capture node warnings ([634aee7](https://github.com/salesforcecli/plugin-telemetry/commit/634aee71b4be8e81d6ec3ef269cc118040132035))



- add telemetry event to capture node warnings ([634aee7](https://github.com/salesforcecli/plugin-telemetry/commit/634aee71b4be8e81d6ec3ef269cc118040132035))
1 change: 1 addition & 0 deletions bin/dev
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const g = (global.oclif = global.oclif || {});

// In dev mode, always show stack traces
global.oclif.debug = true;
global.oclif.performanceEnabled = true;

// Start the CLI
oclif.run().then(require('@oclif/core/flush')).catch(require('@oclif/core/handle'));
2 changes: 1 addition & 1 deletion command-snapshot.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
"command": "telemetry",
"plugin": "@salesforce/plugin-telemetry",
"flags": [],
"flags": ["json"],
"alias": []
}
]
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"dependencies": {
"@oclif/core": "^2.8.2",
"@salesforce/core": "^3.34.6",
"@salesforce/sf-plugins-core": "^2.2.4",
"@salesforce/telemetry": "^3.2.5",
"debug": "^4.3.4",
"tslib": "^2"
Expand Down Expand Up @@ -201,4 +202,4 @@
"output": []
}
}
}
}
Loading

0 comments on commit def30ff

Please sign in to comment.