It is simply impossible for a library to handle errors beyond its control. The only reason promise libraries are throw safe is because promises use return values to assimilate other promises.
If all your code returns promises instead of callbacks, All A+ promise libraries (that's Q and Bluebird in your example but not Parse.promise) will catch runtime errors and bluebird will even report them automatically without the need to .catch
them.
Domains are being deprecated and don't really work well in practice and there is no node-wide solution. Your only option really is to stick to promises app-wide. You must kill and restart the server on an uncaught exception since some parts in node code that throw those do not clean very well after themselves when they throw (this is part of why domains are deprecated to begin with).
So:
- Promises are throw safe for runtime errors if you use promises app-wide.
- If you have to run untrusted code that might throw consider running it in a VM using the vm module.
- Sometimes there are node errors that leave you no choice but to restart a server.
- Promisify at the lowest level possible to avoid promisified functions throwing.
Here is a broader question that discusses async error-handling in NodeJS.