question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

promise handlers fail silently

See original GitHub issue
Q = 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:closed
  • Created 10 years ago
  • Comments:11

github_iconTop GitHub Comments

1reaction
aaylwardcommented, May 10, 2013

adding a .done() will fix your problem

Q = require(‘q’); def = Q.defer(); def.promise.then(function(val) { assert(false) }).done(); def.resolve(1);

0reactions
domeniccommented, May 11, 2013
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found