bluebird.js (656B)
1 'use strict'; 2 3 var EXPORTED_SYMBOLS = ['Promise']; 4 5 var Promise = require('bluebird/promise')(); 6 7 Promise.config({ 8 warnings: true, 9 longStackTraces: true, 10 cancellation: true 11 }); 12 13 // TEMP: Only turn on if debug logging enabled? 14 Promise.onPossiblyUnhandledRejection((e, promise) => { 15 if (e.name == 'ZoteroPromiseInterrupt' || e.handledRejection) { 16 return; 17 } 18 19 dump('Possibly unhandled rejection:\n\n' 20 + (e.message 21 ? e.message + "\n\n" + e.stack.split(/\n/) 22 // Filter out internal Bluebird calls 23 .filter(line => !line.includes('bluebird')) 24 .join('\n') 25 : e) 26 + '\n'); 27 throw e; 28 }); 29 30 module.exports = Promise;