javascript - Bluebirdjs swallowing errors when binded to 'this' -


taking following example:

window.addeventlistener('unhandledrejection', function(e) {   console.error(e); });  var p = new promise(function(resolve, reject) {   console.log('start');   resolve(); });  p.bind(this).then(function() {   console.log('then');   //this.callfunction here   throw new error('err'); }); 

i expect error caught in unhandledrejection event listener , error outputted console. works fine when .bind(this) not in code error seems swallowed when used. explanation why case appreciated. thanks.


Comments

Popular posts from this blog

Receive udp packets in android gstreamer -

php - Extract Text from HTTP referer -

authentication - Mongodb revoke acccess to connect test database -