I'd like to trap when.js unhandled rejections so that I can log them. To accomplish this I've overriden console.warn(), however that can log stuff other than when.js which I'm not interested in.
ref: https://github.com/cujojs/when/blob/master/docs/api.md#debugging-promises
I am using prettymonitor with when.js https://github.com/AriaMinaei/pretty-monitor
If you're on the server-side, you can use the promise rejection hooks. These will work on most promise implementations on the server-side (io.js, bluebird, when, etc):
If you're in a browser environment, things are less standardised. However, When still provides similar hooks there:
There are also local rejection hooks, these are good if you only want to handle rejections of a single instance of the promise library - this is typically useful for when building a library yourself: