-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Listen to error event and throw errors from getData
In Node.js, if nothing is listening to the 'error' event then it will throw. Because we were emitting this event inside a catch, this previously would have rejected the promise. In Node 14 this logs an unhandled promise rejection warning, but in Node 16 this behaviour will cause the Node process to exit. Instead, we are going to use the error event to store an error property, and surface that to clients in the getData() method. This is a breaking change and consumers will have to anticipate that getData() may now throw. Co-authored-by: Kara Brightwell <kara@153.io>
- Loading branch information
1 parent
7ace8dc
commit 77814fb
Showing
3 changed files
with
65 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters