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 -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -