Skip to content

Commit

Permalink
fix: re-throw error regardless if it is a reading undefined error (#1040
Browse files Browse the repository at this point in the history
)

Due to the need to call the custom error handler when it is passed
it makes more sense to generally just re-throw the existing error
if one occurs. So now, there will be a logged message about possibly
using a request scoped service and the error will be fully handled
by the error handler.

ref: #1039
  • Loading branch information
jmcdo29 committed Aug 8, 2023
2 parents 8e50a40 + 8cc3109 commit c2ccfd4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 6 additions & 0 deletions .changeset/happy-rules-work.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'nest-commander': patch
---

The CommandRunnerService now re-throws the error regardless of the contents, it
just adds a new log above the error as well
6 changes: 1 addition & 5 deletions packages/nest-commander/src/command-runner.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,13 +212,9 @@ ${cliPluginError(
err.stack,
'CommandRunnerService',
);
return;
} else {
throw err;
}
} else {
throw err;
}
throw err;
}
});
if (command.command.subCommands?.length) {
Expand Down

0 comments on commit c2ccfd4

Please sign in to comment.