Skip to content

Commit

Permalink
fix: add skipOclifErrorHandling to errors thrown from SfCommand.catch (
Browse files Browse the repository at this point in the history
…#234)

* fix: add skipOclifErrorHandling to errors thrown from SfCommand.catch

* chore: bump oclif/core

---------

Co-authored-by: mshanemc <[email protected]>
  • Loading branch information
mdonnalley and mshanemc authored Mar 1, 2023
1 parent 117d644 commit 82660ef
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"/messages"
],
"dependencies": {
"@oclif/core": "^2.3.1",
"@oclif/core": "^2.4.0",
"@salesforce/core": "^3.33.5",
"@salesforce/kit": "^1.9.0",
"@salesforce/ts-types": "^1.7.3",
Expand Down
5 changes: 4 additions & 1 deletion src/sfCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -477,9 +477,12 @@ export abstract class SfCommand<T> extends Command {
err.stack = sfCommandError.stack;
// @ts-expect-error because code is not on SfError
err.code = codeFromError;
// @ts-expect-error because code is not on SfError
// @ts-expect-error because status is not on SfError
err.status = sfCommandError.status;

// @ts-expect-error because skipOclifErrorHandling is not on SfError
err.skipOclifErrorHandling = true;

throw err;
}

Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -658,10 +658,10 @@
supports-color "^8.1.1"
tslib "^2"

"@oclif/core@^2.1.7", "@oclif/core@^2.3.0", "@oclif/core@^2.3.1":
version "2.3.1"
resolved "https://registry.yarnpkg.com/@oclif/core/-/core-2.3.1.tgz#82d977338c68b3faeda84f780c2f97a3dd322cb2"
integrity sha512-18CkjjF16hwhBd/42z+0CHAwvZlBfpyCmdZxpasN/od8c/hdm0oDEJvVB33/xD0LDYg8glKoQ5zVNVvPM/uJ/Q==
"@oclif/core@^2.1.7", "@oclif/core@^2.3.0", "@oclif/core@^2.3.1", "@oclif/core@^2.4.0":
version "2.4.0"
resolved "https://registry.yarnpkg.com/@oclif/core/-/core-2.4.0.tgz#8e5983dd0d50a3c0c170a844fe8925cb639f0a9f"
integrity sha512-wWUnOOfQQty0k1Cstm/iWW6pbG0mHzU7rcUtab2Sni9kjBPCcy6ENTgpsWbb/WdITopqtXmvpYII2fgcjKdzUA==
dependencies:
"@types/cli-progress" "^3.11.0"
ansi-escapes "^4.3.2"
Expand Down

0 comments on commit 82660ef

Please sign in to comment.