Fix logging of unhandled promise rejections
This commit is contained in:
parent
4b0e2a9554
commit
47f7f3a93f
|
@ -16,13 +16,14 @@ Promise.onPossiblyUnhandledRejection((e, promise) => {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
typeof Zotero !== 'undefined' && Zotero.debug('Possibly unhandled rejection:\n\n'
|
dump('Possibly unhandled rejection:\n\n'
|
||||||
+ (e.message
|
+ (e.message
|
||||||
? e.message + "\n\n" + e.stack.split(/\n/)
|
? e.message + "\n\n" + e.stack.split(/\n/)
|
||||||
// Filter out internal Bluebird calls
|
// Filter out internal Bluebird calls
|
||||||
.filter(line => !line.includes('bluebird'))
|
.filter(line => !line.includes('bluebird'))
|
||||||
.join('\n')
|
.join('\n')
|
||||||
: e), 1);
|
: e)
|
||||||
|
+ '\n');
|
||||||
throw e;
|
throw e;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user