Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Managing Node.js Callback Hell with Promises, Generators and Other Approaches. Parent comment
function g() { return somePromise.then(function() { setTimeout(function() { throw new Error(); }, 500); }); } g(); // crash
However if you use a promise-based timeout too:
function f() { return somePromise.then(function() { return Q.delay(1000).then(function() { throw new Error("Oops"); }); }); } f().catch(function(e) { console.log(e.message); // logs Ooops. });
There are no comments on this comment yet.
However if you use a promise-based timeout too:
No problem bubbling that.