Monitors unhandled rejections in when.js and passes them to a callback