Fix logging of unhandled promise rejections

This commit is contained in:
Dan Stillman 2017-06-02 10:37:14 -04:00
parent 4b0e2a9554
commit 47f7f3a93f

View file

@ -16,13 +16,14 @@ Promise.onPossiblyUnhandledRejection((e, promise) => {
return;
}
typeof Zotero !== 'undefined' && Zotero.debug('Possibly unhandled rejection:\n\n'
dump('Possibly unhandled rejection:\n\n'
+ (e.message
? e.message + "\n\n" + e.stack.split(/\n/)
// Filter out internal Bluebird calls
.filter(line => !line.includes('bluebird'))
.join('\n')
: e), 1);
: e)
+ '\n');
throw e;
});