Fix logging of unhandled promise rejections
This commit is contained in:
parent
4b0e2a9554
commit
47f7f3a93f
1 changed files with 3 additions and 2 deletions
|
@ -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;
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue