2026-07-20 16:05:17 +00:00
|
|
|
// Module ID: 992
|
2026-07-24 07:16:23 +00:00
|
|
|
// Function ID: 10647
|
2026-07-20 16:05:17 +00:00
|
|
|
// Name: reactNativeErrorHandlersIntegration
|
2026-07-23 10:11:24 +00:00
|
|
|
// Dependencies: [978, 793, 794, 790, 993]
|
2026-07-20 16:05:17 +00:00
|
|
|
|
|
|
|
|
// Module 992 (reactNativeErrorHandlersIntegration)
|
2026-07-23 10:11:24 +00:00
|
|
|
const require = arg1;
|
|
|
|
|
const dependencyMap = arg6;
|
2026-07-20 16:05:17 +00:00
|
|
|
let fn = this;
|
|
|
|
|
if (this) {
|
|
|
|
|
fn = this.__awaiter;
|
|
|
|
|
}
|
|
|
|
|
if (!fn) {
|
|
|
|
|
fn = (arg0, arg1, arg2, arg3) => {
|
|
|
|
|
let _Promise = arg2;
|
2026-07-23 10:11:24 +00:00
|
|
|
let closure_0 = arg0;
|
|
|
|
|
let closure_1 = arg1;
|
2026-07-20 16:05:17 +00:00
|
|
|
let closure_3 = arg3;
|
|
|
|
|
if (!arg2) {
|
|
|
|
|
_Promise = Promise;
|
|
|
|
|
}
|
|
|
|
|
_Promise = new _Promise((arg0, arg1) => {
|
2026-07-23 10:11:24 +00:00
|
|
|
let closure_0 = arg0;
|
|
|
|
|
let closure_1 = arg1;
|
2026-07-20 16:05:17 +00:00
|
|
|
function fulfilled(arg0) {
|
|
|
|
|
step(iter.next(arg0));
|
|
|
|
|
}
|
2026-07-23 10:11:24 +00:00
|
|
|
let iter = function rejected(arg0) {
|
2026-07-20 16:05:17 +00:00
|
|
|
step(iter.throw(arg0));
|
|
|
|
|
};
|
|
|
|
|
function step(iter) {
|
|
|
|
|
if (iter.done) {
|
2026-07-23 10:11:24 +00:00
|
|
|
callback(iter.value);
|
2026-07-20 16:05:17 +00:00
|
|
|
} else {
|
2026-07-23 10:11:24 +00:00
|
|
|
(function adopt(value) {
|
2026-07-20 16:05:17 +00:00
|
|
|
let tmp = value;
|
2026-07-23 10:11:24 +00:00
|
|
|
let closure_0 = value;
|
|
|
|
|
if (!(value instanceof fulfilled)) {
|
|
|
|
|
const prototype = fulfilled.prototype;
|
|
|
|
|
tmp = new fulfilled((arg0) => {
|
|
|
|
|
arg0(closure_0);
|
2026-07-20 16:05:17 +00:00
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
return tmp;
|
2026-07-23 10:11:24 +00:00
|
|
|
})(iter.value).then(fulfilled, iter);
|
|
|
|
|
const promise = (function adopt(value) {
|
2026-07-20 16:05:17 +00:00
|
|
|
let tmp = value;
|
2026-07-23 10:11:24 +00:00
|
|
|
let closure_0 = value;
|
|
|
|
|
if (!(value instanceof fulfilled)) {
|
|
|
|
|
const prototype = fulfilled.prototype;
|
|
|
|
|
tmp = new fulfilled((arg0) => {
|
|
|
|
|
arg0(closure_0);
|
2026-07-20 16:05:17 +00:00
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
return tmp;
|
2026-07-23 10:11:24 +00:00
|
|
|
})(iter.value);
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
|
|
|
|
}
|
2026-07-23 10:11:24 +00:00
|
|
|
let items = closure_1;
|
|
|
|
|
if (!closure_1) {
|
2026-07-20 16:05:17 +00:00
|
|
|
items = [];
|
|
|
|
|
}
|
2026-07-23 10:11:24 +00:00
|
|
|
iter = iter.apply(closure_0, items);
|
2026-07-20 16:05:17 +00:00
|
|
|
step(iter.next());
|
|
|
|
|
});
|
|
|
|
|
return _Promise;
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
let closure_3 = {
|
|
|
|
|
onUnhandled(id, originalException) {
|
2026-07-23 10:11:24 +00:00
|
|
|
let obj = require(794) /* registerSpanErrorInstrumentation */;
|
2026-07-20 16:05:17 +00:00
|
|
|
obj = { data: obj, originalException };
|
|
|
|
|
obj = { id };
|
|
|
|
|
let syntheticError;
|
|
|
|
|
if (!obj4.isErrorLike(originalException)) {
|
2026-07-23 10:11:24 +00:00
|
|
|
syntheticError = require(790) /* createSyntheticError */.createSyntheticError();
|
|
|
|
|
const obj5 = require(790) /* createSyntheticError */;
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
|
|
|
|
obj.syntheticException = syntheticError;
|
2026-07-23 10:11:24 +00:00
|
|
|
obj.mechanism = { handled: true, type: "onunhandledrejection" };
|
2026-07-20 16:05:17 +00:00
|
|
|
obj.captureException(originalException, obj);
|
|
|
|
|
},
|
|
|
|
|
onHandled(displayId, error) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
arg5.reactNativeErrorHandlersIntegration = function reactNativeErrorHandlersIntegration(arg0) {
|
|
|
|
|
if (arguments.length > 0) {
|
|
|
|
|
if (undefined !== arguments[0]) {
|
|
|
|
|
const first = arguments[0];
|
|
|
|
|
}
|
|
|
|
|
let closure_0 = {};
|
2026-07-23 10:11:24 +00:00
|
|
|
let obj = {
|
2026-07-20 16:05:17 +00:00
|
|
|
name: "ReactNativeErrorHandlers",
|
|
|
|
|
setupOnce() {
|
2026-07-23 10:11:24 +00:00
|
|
|
(function setup(onunhandledrejection) {
|
2026-07-20 16:05:17 +00:00
|
|
|
if (onunhandledrejection.onunhandledrejection) {
|
2026-07-23 10:11:24 +00:00
|
|
|
(function setupUnhandledRejectionsTracking(patchGlobalPromise) {
|
|
|
|
|
let obj = callback(outer3_1[0]);
|
2026-07-20 16:05:17 +00:00
|
|
|
if (obj.isHermesEnabled()) {
|
2026-07-23 10:11:24 +00:00
|
|
|
let _HermesInternal = callback(outer3_1[1]).RN_GLOBAL_OBJ.HermesInternal;
|
2026-07-20 16:05:17 +00:00
|
|
|
let prop;
|
|
|
|
|
if (null !== _HermesInternal) {
|
|
|
|
|
if (undefined !== tmp3) {
|
|
|
|
|
prop = _HermesInternal.enablePromiseRejectionTracker;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (prop) {
|
|
|
|
|
_HermesInternal = undefined;
|
2026-07-23 10:11:24 +00:00
|
|
|
if (null !== callback(outer3_1[1]).RN_GLOBAL_OBJ) {
|
|
|
|
|
if (undefined !== callback(outer3_1[1]).RN_GLOBAL_OBJ) {
|
|
|
|
|
_HermesInternal = callback(outer3_1[1]).RN_GLOBAL_OBJ.HermesInternal;
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
let hasPromise;
|
|
|
|
|
if (null !== _HermesInternal) {
|
|
|
|
|
if (undefined !== tmp14) {
|
|
|
|
|
hasPromise = tmp14.hasPromise;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
let callResult;
|
|
|
|
|
if (null !== hasPromise) {
|
|
|
|
|
if (undefined !== obj2) {
|
|
|
|
|
callResult = obj2.call(_HermesInternal);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (callResult) {
|
2026-07-23 10:11:24 +00:00
|
|
|
const debug3 = callback(outer3_1[2]).debug;
|
2026-07-20 16:05:17 +00:00
|
|
|
debug3.log("Using Hermes native promise rejection tracking");
|
2026-07-23 10:11:24 +00:00
|
|
|
const _HermesInternal2 = callback(outer3_1[1]).RN_GLOBAL_OBJ.HermesInternal;
|
|
|
|
|
obj = { allRejections: true, onUnhandled: outer3_3.onUnhandled, onHandled: outer3_3.onHandled };
|
2026-07-20 16:05:17 +00:00
|
|
|
const result = _HermesInternal2.enablePromiseRejectionTracker(obj);
|
2026-07-23 10:11:24 +00:00
|
|
|
const debug4 = callback(outer3_1[2]).debug;
|
2026-07-20 16:05:17 +00:00
|
|
|
debug4.log("Unhandled promise rejections will be caught by Sentry.");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (obj3.isWeb()) {
|
2026-07-23 10:11:24 +00:00
|
|
|
const debug2 = callback(outer3_1[2]).debug;
|
2026-07-20 16:05:17 +00:00
|
|
|
debug2.log("Using Browser JS promise rejection tracking for React Native Web");
|
2026-07-23 10:11:24 +00:00
|
|
|
const result1 = callback(outer3_1[2]).addGlobalUnhandledRejectionInstrumentationHandler((originalException) => {
|
|
|
|
|
let obj = callback(outer4_1[2]);
|
2026-07-20 16:05:17 +00:00
|
|
|
obj = { originalException };
|
|
|
|
|
let syntheticError;
|
|
|
|
|
if (!obj3.isErrorLike(originalException)) {
|
2026-07-23 10:11:24 +00:00
|
|
|
syntheticError = callback(outer4_1[3]).createSyntheticError();
|
|
|
|
|
const obj4 = callback(outer4_1[3]);
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
|
|
|
|
obj.syntheticException = syntheticError;
|
2026-07-23 10:11:24 +00:00
|
|
|
obj.mechanism = { handled: false, type: "onunhandledrejection" };
|
2026-07-20 16:05:17 +00:00
|
|
|
obj.captureException(originalException, obj);
|
|
|
|
|
});
|
2026-07-23 10:11:24 +00:00
|
|
|
const obj9 = callback(outer3_1[2]);
|
2026-07-20 16:05:17 +00:00
|
|
|
} else if (patchGlobalPromise) {
|
|
|
|
|
let tmp21Result = tmp21(tmp22[4]);
|
|
|
|
|
tmp21Result.polyfillPromise();
|
|
|
|
|
tmp21Result = tmp21(tmp22[4]);
|
|
|
|
|
const result2 = tmp21Result.requireRejectionTracking();
|
2026-07-23 10:11:24 +00:00
|
|
|
obj = { allRejections: true, onUnhandled: outer3_3.onUnhandled, onHandled: outer3_3.onHandled };
|
2026-07-20 16:05:17 +00:00
|
|
|
result2.enable(obj);
|
|
|
|
|
tmp21(tmp22[4]).checkPromiseAndWarn();
|
|
|
|
|
const tmp21Result1 = tmp21(tmp22[4]);
|
|
|
|
|
} else {
|
|
|
|
|
const debug = tmp21(tmp22[2]).debug;
|
|
|
|
|
debug.log("Unhandled promise rejections will not be caught by Sentry.");
|
|
|
|
|
}
|
2026-07-23 10:11:24 +00:00
|
|
|
})(onunhandledrejection.patchGlobalPromise);
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
|
|
|
|
if (onunhandledrejection.onerror) {
|
2026-07-23 10:11:24 +00:00
|
|
|
(function setupErrorUtilsGlobalHandler() {
|
2026-07-20 16:05:17 +00:00
|
|
|
const self = this;
|
2026-07-23 10:11:24 +00:00
|
|
|
let c1 = false;
|
|
|
|
|
const _ErrorUtils = callback(outer3_1[1]).RN_GLOBAL_OBJ.ErrorUtils;
|
2026-07-20 16:05:17 +00:00
|
|
|
if (_ErrorUtils) {
|
|
|
|
|
let callResult;
|
|
|
|
|
if (null !== _ErrorUtils.getGlobalHandler) {
|
|
|
|
|
if (undefined !== getGlobalHandler) {
|
|
|
|
|
callResult = getGlobalHandler.call(_ErrorUtils);
|
|
|
|
|
}
|
|
|
|
|
}
|
2026-07-23 10:11:24 +00:00
|
|
|
let closure_2 = callResult;
|
2026-07-20 16:05:17 +00:00
|
|
|
_ErrorUtils.setGlobalHandler((arg0, arg1) => {
|
2026-07-23 10:11:24 +00:00
|
|
|
let closure_0 = arg0;
|
2026-07-20 16:05:17 +00:00
|
|
|
let closure_1 = arg1;
|
2026-07-24 07:16:23 +00:00
|
|
|
return outer4_2(closure_0, undefined, undefined, /* F10664 */ function*() { ... });
|
2026-07-20 16:05:17 +00:00
|
|
|
});
|
|
|
|
|
} else {
|
2026-07-23 10:11:24 +00:00
|
|
|
let debug = callback(outer3_1[2]).debug;
|
2026-07-20 16:05:17 +00:00
|
|
|
debug.warn("ErrorUtils not found. Can be caused by different environment for example react-native-web.");
|
|
|
|
|
}
|
2026-07-23 10:11:24 +00:00
|
|
|
})();
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
2026-07-23 10:11:24 +00:00
|
|
|
})(Object.assign({ onerror: true, onunhandledrejection: true, patchGlobalPromise: true }, closure_0));
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
return obj;
|
|
|
|
|
}
|
|
|
|
|
};
|