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

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

c# - Abstract method in public abstract class implementing an internal interface doesn't compile? -

authentication - Mongodb revoke acccess to connect test database -