mirror of
https://github.com/MarSeventh/CloudFlare-ImgBed.git
synced 2026-04-26 23:25:11 +00:00
init
This commit is contained in:
41
node_modules/@sentry/utils/cjs/instrument/globalUnhandledRejection.js
generated
vendored
Normal file
41
node_modules/@sentry/utils/cjs/instrument/globalUnhandledRejection.js
generated
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
const worldwide = require('../worldwide.js');
|
||||
const _handlers = require('./_handlers.js');
|
||||
|
||||
let _oldOnUnhandledRejectionHandler = null;
|
||||
|
||||
/**
|
||||
* Add an instrumentation handler for when an unhandled promise rejection is captured.
|
||||
*
|
||||
* Use at your own risk, this might break without changelog notice, only used internally.
|
||||
* @hidden
|
||||
*/
|
||||
function addGlobalUnhandledRejectionInstrumentationHandler(
|
||||
handler,
|
||||
) {
|
||||
const type = 'unhandledrejection';
|
||||
_handlers.addHandler(type, handler);
|
||||
_handlers.maybeInstrument(type, instrumentUnhandledRejection);
|
||||
}
|
||||
|
||||
function instrumentUnhandledRejection() {
|
||||
_oldOnUnhandledRejectionHandler = worldwide.GLOBAL_OBJ.onunhandledrejection;
|
||||
|
||||
worldwide.GLOBAL_OBJ.onunhandledrejection = function (e) {
|
||||
const handlerData = e;
|
||||
_handlers.triggerHandlers('unhandledrejection', handlerData);
|
||||
|
||||
if (_oldOnUnhandledRejectionHandler && !_oldOnUnhandledRejectionHandler.__SENTRY_LOADER__) {
|
||||
// eslint-disable-next-line prefer-rest-params
|
||||
return _oldOnUnhandledRejectionHandler.apply(this, arguments);
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
worldwide.GLOBAL_OBJ.onunhandledrejection.__SENTRY_INSTRUMENTED__ = true;
|
||||
}
|
||||
|
||||
exports.addGlobalUnhandledRejectionInstrumentationHandler = addGlobalUnhandledRejectionInstrumentationHandler;
|
||||
//# sourceMappingURL=globalUnhandledRejection.js.map
|
||||
Reference in New Issue
Block a user