You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One of the pitfalls of interacting with Promise-based APIs is the tendency for important errors to be silently swallowed unless an explicit rejection handler is specified.
For example:
promise.then(function(){// logic in your callback throws an error// and it is interpreted as a rejection.thrownewError('Boom!');});// The error is silently swallowed.
This problem can be addressed by terminating the Promise chain with the done() method:
promise.then(function(){// logic in your callback throws an error// and it is interpreted as a rejection.thrownewError('Boom!');}).done();// The error is thrown on the next tick of the event loop.
The done() method ensures that any unhandled rejections are rethrown as Errors.
The text was updated successfully, but these errors were encountered:
Implement
done()
and add to README.md.One of the pitfalls of interacting with Promise-based APIs is the tendency for important errors to be silently swallowed unless an explicit rejection handler is specified.
For example:
This problem can be addressed by terminating the Promise chain with the
done()
method:The
done()
method ensures that any unhandled rejections are rethrown as Errors.The text was updated successfully, but these errors were encountered: