Skip to content

Commit

Permalink
chore: add changeset for error handler
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcdo29 committed May 18, 2021
1 parent fcf4300 commit 7cce284
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .changeset/eight-radios-bow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'nest-commander': minor
---

Add ability to use error handler for commander errors

Within the `CommandFactory.run()` now as a second parameter you can either keep passing just the logger, or you can pass in an object with the logger and an `errorHandler`. Ths `errorHandler` is a method that takes in an `Error` and returns `void`. The errorHandler will be passed to commander's `exitOverride` method, if it exists. This is useful for better handling errors and giving the dev more control over what is seen. There is also no longer an `unhandledPromiseRejection` on empty commands.

0 comments on commit 7cce284

Please sign in to comment.