Files
klz-cables.com/.pnpm-store/v10/files/2d/23d7fb53ef7336868157f7b67dc7259588bc8138306e4647eb3bfff557a9ad352fc6e20f009b800b407a423afc7445f1b867fb351a3f836cbbeb7e33584b0b
Marc Mintel 5397309103
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

42 lines
1.4 KiB
Plaintext

import { GLOBAL_OBJ } from '../utils/worldwide.js';
import { addHandler, maybeInstrument, triggerHandlers } from './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';
addHandler(type, handler);
maybeInstrument(type, instrumentUnhandledRejection);
}
function instrumentUnhandledRejection() {
_oldOnUnhandledRejectionHandler = GLOBAL_OBJ.onunhandledrejection;
// Note: The reason we are doing window.onunhandledrejection instead of window.addEventListener('unhandledrejection')
// is that we are using this handler in the Loader Script, to handle buffered rejections consistently
GLOBAL_OBJ.onunhandledrejection = function (e) {
const handlerData = e;
triggerHandlers('unhandledrejection', handlerData);
if (_oldOnUnhandledRejectionHandler) {
// eslint-disable-next-line prefer-rest-params
return _oldOnUnhandledRejectionHandler.apply(this, arguments);
}
return true;
};
GLOBAL_OBJ.onunhandledrejection.__SENTRY_INSTRUMENTED__ = true;
}
export { addGlobalUnhandledRejectionInstrumentationHandler };
//# sourceMappingURL=globalUnhandledRejection.js.map