promise handlers fail silently
See original GitHub issueQ = require('q');
def = Q.defer();
def.promise.then(function(val) { assert(false) })
def.resolve(1);
>
This makes testing on promises with test facilities that depend on .assert and family impossible
Issue Analytics
- State:
- Created 10 years ago
- Comments:11
Top Results From Across the Web
Why does this promise silently fail? - javascript - Stack Overflow
It is not swallowing that error, but if a then or catch handler results in an error, then the current promise will be...
Read more >Promise.all() dies silently if no resolve · Issue #29355 - GitHub
When I create a Promise.all() call with a promise that never resolves, instead of throwing an error, it just silently kills the program, ......
Read more >Error handling with promises - The Modern JavaScript Tutorial
Promise chains are great at error handling. When a promise rejects, the control jumps to the closest rejection handler.
Read more >Using promises - JavaScript - MDN Web Docs
The inner error-silencing catch handler only catches failures from doSomethingOptional() and doSomethingExtraNice() , after which the code ...
Read more >Error handling in promises - Gleb Bahmutov
Handling the errors in the promise chain. ... The promise chain silently hides the exception, as if nothing happened. Here is an example:...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
adding a .done() will fix your problem
Q = require(‘q’); def = Q.defer(); def.promise.then(function(val) { assert(false) }).done(); def.resolve(1);
The Q Continuum!