Restore logging of unhandled errors from Bluebird (since 9aa057edee
)
This commit is contained in:
parent
1e459287de
commit
8bc76dd2db
1 changed files with 19 additions and 0 deletions
|
@ -63,7 +63,26 @@ Services.scriptloader.loadSubScript("resource://zotero/polyfill.js");
|
||||||
this.isWin;
|
this.isWin;
|
||||||
this.initialURL; // used by Schema to show the changelog on upgrades
|
this.initialURL; // used by Schema to show the changelog on upgrades
|
||||||
|
|
||||||
|
// Load and configure Bluebird
|
||||||
this.Promise = require('resource://zotero/bluebird/bluebird.js');
|
this.Promise = require('resource://zotero/bluebird/bluebird.js');
|
||||||
|
this.Promise.config({
|
||||||
|
warnings: true,
|
||||||
|
longStackTraces: true,
|
||||||
|
cancellation: true
|
||||||
|
});
|
||||||
|
this.Promise.onPossiblyUnhandledRejection(function (e, promise) {
|
||||||
|
if (e.name == 'ZoteroPromiseInterrupt' || e.handledRejection) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Zotero.debug('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);
|
||||||
|
throw e;
|
||||||
|
});
|
||||||
|
|
||||||
this.getActiveZoteroPane = function() {
|
this.getActiveZoteroPane = function() {
|
||||||
var win = Services.wm.getMostRecentWindow("navigator:browser");
|
var win = Services.wm.getMostRecentWindow("navigator:browser");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue