3 ms·
The first time I used Promises (and really, the first time I did any serious work in Node), I prototyped an isomorphic web server: https://github.com/appsforar
by bsimpson 12y ago
The first time I used Promises (and really, the first time I did any serious work in Node), I prototyped an isomorphic web server:
https://github.com/appsforartists/ambidex/blob/master/src/Ambidex.server.js#L300-L305 https://github.com/appsforartists/ambidex/blob/master/src/Am...
In three different places in that file, you'll find a Promise that ends in ".catch(error => console.error(error.stack))`. Before I learned that bit of boilerplate, I'd spend an hour staring at my screen wondering why things were silently broken.
It's mindblowing that errors are implicitly suppressed by default with Promises. console.error ought to be automatically invoked for any error that makes it to the root scope without a .catch() (just like it is with sync code).
- ubolonton_ 12y agoIn Python it's possible, with the use of destructors (like in Twisted). I don't think it's possible in Javascript.