Skip to content

Commit

Permalink
[#491] Fixed additional edge case not being covered by decorator `pre…
Browse files Browse the repository at this point in the history
…ttifiedErrors()`

Explanation here: #491 (comment)
  • Loading branch information
Luna-Klatzer committed Oct 21, 2023
1 parent c9698c6 commit 889ab3a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions kipper/cli/src/decorators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,13 @@ export function prettifiedErrors<TProto extends Command>() {
try {
await originalFunc.call(this);
} catch (error) {
const cliError = error instanceof KipperCLIError;
const cliError =
error instanceof KipperCLIError ||
error instanceof OclifCLIError;
const internalError = error instanceof KipperInternalError;

// Error configuration
const name: string = cliError ? "Error" : internalError ? "Unexpected Internal Error" : "Unexpected CLI Error";
const name: string = cliError ? "Error" : internalError ? "Unexpected Internal Error" : "CLI Error";
const msg: string =
error && typeof error === "object" && "message" in error && typeof error.message === "string"
? error.message
Expand Down

0 comments on commit 889ab3a

Please sign in to comment.