Re:Error Handling in Nodejs
by dmethvin on Friday July 17, 2015 @02:26PM
(#9904345)
Perhaps the gp meant this case?
[ Parent
| on HN ]
No built-in help with native promises, but with something like Bluebird you'd prefer:
something().then(() => {
return Promise.delay(1000).then(() => {
whoops_not_a_function();
});
}).catch(() => {
// whoops_not_a_function is not defined
});
...or write Promise_delay yourself on top of native promises (but really just use Bluebird).