2026-07-29 08:29:29 +00:00
// Module ID: 1016
// Function ID: 1017
// Name: reactNativeErrorHandlersIntegration
// Dependencies: [1002, 816, 817, 813, 1017]
// Module 1016 (reactNativeErrorHandlersIntegration)
const require = arg1 ;
const dependencyMap = arg6 ;
let fn = this ;
if ( this ) {
fn = this . _ _awaiter ;
}
if ( ! fn ) {
fn = ( arg0 , arg1 , arg2 , arg3 ) => {
let closure _0 = arg0 ;
let closure _1 = arg1 ;
let _Promise = arg2 ;
let closure _3 = arg3 ;
if ( ! arg2 ) {
_Promise = Promise ;
}
_Promise = new _Promise ( ( arg0 , arg1 ) => {
let closure _0 = arg0 ;
let closure _1 = arg1 ;
function fulfilled ( arg0 ) {
try {
step ( iter . next ( arg0 ) ) ;
} catch ( tmp5 ) {
callback2 ( tmp5 ) ;
}
}
function rejected ( arg0 ) {
try {
step ( iter . throw ( arg0 ) ) ;
} catch ( tmp5 ) {
callback2 ( tmp5 ) ;
}
}
let iter = rejected ;
function step ( done ) {
if ( done . done ) {
callback ( done . value ) ;
} else {
let tmp = done . value ;
callback = tmp ;
if ( ! ( tmp instanceof fulfilled ) ) {
tmp = new tmp ( ( arg0 ) => {
arg0 ( closure _0 ) ;
} ) ;
}
tmp . then ( fulfilled , iter ) ;
}
}
let items = closure _1 ;
if ( ! closure _1 ) {
items = [ ] ;
}
iter = iter . apply ( closure _0 , items ) ;
const iter2 = iter . next ( ) ;
const value = iter2 . value ;
if ( iter2 . done ) {
arg0 ( value ) ;
} else {
closure _0 = value ;
let tmp3 = value ;
if ( ! ( value instanceof fulfilled ) ) {
tmp3 = new tmp3 ( ( arg0 ) => {
arg0 ( closure _0 ) ;
} ) ;
}
tmp3 . then ( fulfilled , rejected ) ;
}
} ) ;
return _Promise ;
} ;
}
let obj = {
onUnhandled ( id , originalException ) {
let obj = require ( 817 ) /* registerSpanErrorInstrumentation */ ;
obj = { data : obj , originalException , syntheticException : null , mechanism : null } ;
obj = { id } ;
let syntheticError ;
if ( ! obj4 . isErrorLike ( originalException ) ) {
syntheticError = require ( 813 ) /* createSyntheticError */ . createSyntheticError ( ) ;
const tmpResult = require ( 813 ) /* createSyntheticError */ ;
}
obj [ 2 ] = syntheticError ;
obj [ 3 ] = { handled : true , type : "onunhandledrejection" } ;
obj . captureException ( originalException , obj ) ;
} ,
onHandled ( displayId , error ) {
}
} ;
arg5 . reactNativeErrorHandlersIntegration = ( ) => {
let obj = arg0 ;
if ( arg0 === undefined ) {
obj = { } ;
}
obj = {
name : "ReactNativeErrorHandlers" ,
setupOnce ( ) {
const merged = Object . assign ( { onerror : true , onunhandledrejection : true , patchGlobalPromise : true } , c0 ) ;
if ( merged . onunhandledrejection ) {
( function setupUnhandledRejectionsTracking ( patchGlobalPromise ) {
try {
let obj = callback ( tmp7 [ 0 ] ) ;
if ( obj . isHermesEnabled ( ) ) {
let _HermesInternal = tmp3 ( tmp5 [ 1 ] ) . RN _GLOBAL _OBJ . HermesInternal ;
let prop ;
if ( null !== _HermesInternal ) {
if ( undefined !== tmp8 ) {
prop = _HermesInternal . enablePromiseRejectionTracker ;
}
}
if ( prop ) {
_HermesInternal = undefined ;
if ( null !== tmp3 ( tmp5 [ 1 ] ) . RN _GLOBAL _OBJ ) {
if ( undefined !== tmp3 ( tmp5 [ 1 ] ) . RN _GLOBAL _OBJ ) {
_HermesInternal = tmp3 ( tmp5 [ 1 ] ) . RN _GLOBAL _OBJ . HermesInternal ;
}
}
let hasPromise ;
if ( null !== _HermesInternal ) {
if ( undefined !== tmp19 ) {
hasPromise = tmp19 . hasPromise ;
}
}
if ( null !== hasPromise ) {
if ( undefined !== tmp23 ) {
const call = tmp23 . call ;
if ( typeof call === "unknown" ) {
let callResult = tmp23 ( ) ;
} else {
callResult = call ( _HermesInternal ) ;
}
}
}
if ( undefined ) {
const debug3 = tmp3 ( tmp5 [ 2 ] ) . debug ;
debug3 . log ( "Using Hermes native promise rejection tracking" ) ;
const _HermesInternal2 = tmp3 ( tmp5 [ 1 ] ) . RN _GLOBAL _OBJ . HermesInternal ;
obj = { allRejections : true , onUnhandled : null , onHandled : null } ;
( { onUnhandled : obj6 [ 1 ] , onHandled : obj6 [ 2 ] } = closure _3 ) ;
let result = _HermesInternal2 . enablePromiseRejectionTracker ( obj ) ;
const debug4 = tmp3 ( tmp5 [ 2 ] ) . debug ;
debug4 . log ( "Unhandled promise rejections will be caught by Sentry." ) ;
}
}
}
let tmp3Result = tmp3 ( tmp5 [ 0 ] ) ;
if ( tmp3Result . isWeb ( ) ) {
const debug2 = tmp3 ( tmp5 [ 2 ] ) . debug ;
debug2 . log ( "Using Browser JS promise rejection tracking for React Native Web" ) ;
tmp3Result = tmp3 ( tmp5 [ 2 ] ) ;
const result1 = tmp3Result . addGlobalUnhandledRejectionInstrumentationHandler ( ( originalException ) => {
let obj = callback ( 817 ) ;
obj = { originalException , syntheticException : null , mechanism : null } ;
let syntheticError ;
if ( ! obj3 . isErrorLike ( originalException ) ) {
syntheticError = callback ( 813 ) . createSyntheticError ( ) ;
const tmpResult = callback ( 813 ) ;
}
obj [ 1 ] = syntheticError ;
obj [ 2 ] = { handled : false , type : "onunhandledrejection" } ;
obj . captureException ( originalException , obj ) ;
} ) ;
} else if ( patchGlobalPromise ) {
tmp3 ( tmp5 [ 4 ] ) . polyfillPromise ( ) ;
( function attachUnhandledRejectionHandler ( ) {
let obj = callback ( 1017 ) ;
const result = obj . requireRejectionTracking ( ) ;
obj = { allRejections : true , onUnhandled : closure _3 . onUnhandled , onHandled : closure _3 . onHandled } ;
result . enable ( obj ) ;
} ) ( ) ;
const tmp3Result1 = tmp3 ( tmp5 [ 4 ] ) ;
tmp3 ( tmp5 [ 4 ] ) . checkPromiseAndWarn ( ) ;
const tmp3Result2 = tmp3 ( tmp5 [ 4 ] ) ;
} else {
const debug = tmp3 ( tmp5 [ 2 ] ) . debug ;
debug . log ( "Unhandled promise rejections will not be caught by Sentry." ) ;
}
} catch ( err ) {
const debug5 = callback ( tmp7 [ 2 ] ) . debug ;
debug5 . warn ( "Failed to set up promise rejection tracking. Unhandled promise rejections will not be caught by Sentry.See https://docs.sentry.io/platforms/react-native/troubleshooting/ for more details." ) ;
}
} ) ( merged . patchGlobalPromise ) ;
}
if ( merged . onerror ) {
c0 = false ;
const _ErrorUtils = obj ( outer1 _1 [ 1 ] ) . RN _GLOBAL _OBJ . ErrorUtils ;
if ( _ErrorUtils ) {
if ( null !== _ErrorUtils . getGlobalHandler ) {
if ( undefined !== getGlobalHandler ) {
let call = getGlobalHandler . call ;
typeof call === "unknown" ? getGlobalHandler ( ) : call ( _ErrorUtils ) ;
}
}
let closure _1 = tmp7 ;
_ErrorUtils . setGlobalHandler ( ( arg0 , arg1 ) => {
let closure _0 = arg0 ;
let closure _1 = arg1 ;
return outer1 _2 ( undefined , undefined , undefined , function * ( ) {
if ( c3 === 2 ) {
c3 = 3 ;
HermesBuiltin . throwTypeError ( ) ;
} else if ( tmp4 === 3 ) {
if ( arg0 === 1 ) {
throw arg1 ;
} else if ( arg0 === 2 ) {
let obj = { value : null , done : true } ;
obj [ 0 ] = arg1 ;
return obj ;
} else {
2026-08-05 07:35:12 +00:00
return { value : "T" , done : null } ;
2026-07-29 08:29:29 +00:00
}
} else {
try {
c3 = 2 ;
if ( 0 === closure _2 ) {
if ( arg0 === 1 ) {
c3 = 3 ;
throw arg1 ;
} else if ( arg0 === 2 ) {
c3 = 3 ;
obj = { value : null , done : true } ;
obj [ 0 ] = arg1 ;
return obj ;
} else {
let obj2 = 0 ;
let client = tmp2 ;
client = undefined ;
obj2 = undefined ;
closure _2 = undefined ;
if ( outer1 _1 ) {
if ( outer1 _0 ) {
const debug2 = callback ( 817 ) . debug ;
debug2 . log ( "Encountered multiple fatals in a row. The latest:" , outer1 _0 ) ;
c3 = 3 ;
let obj1 = { value : null , done : true } ;
obj1 [ 0 ] = undefined ;
return obj1 ;
} else {
outer1 _0 = true ;
}
}
let obj3 = callback ( 817 ) ;
client = obj3 . getClient ( ) ;
if ( client ) {
obj2 = { originalException : null , attachments : null } ;
obj2 [ 0 ] = outer1 _0 ;
const currentScope = callback ( 817 ) . getCurrentScope ( ) ;
obj2 [ 1 ] = currentScope . getScopeData ( ) . attachments ;
closure _2 = 1 ;
c3 = 1 ;
obj3 = { value : null , done : false } ;
obj3 [ 0 ] = client . eventFromException ( outer1 _0 , obj2 ) ;
return obj3 ;
} else {
let debug = callback ( 817 ) . debug ;
debug . error ( "Sentry client is missing, the error event might be lost." , outer1 _0 ) ;
outer1 _1 ( outer1 _0 , outer1 _1 ) ;
c3 = 3 ;
const obj4 = { value : null , done : true } ;
obj4 [ 0 ] = undefined ;
return obj4 ;
}
}
} else if ( arg0 === 1 ) {
c3 = 3 ;
throw arg1 ;
} else if ( arg0 === 2 ) {
c3 = 3 ;
const obj5 = { value : null , done : true } ;
obj5 [ 0 ] = arg1 ;
return obj5 ;
} else {
closure _2 = arg1 ;
if ( obj2 ) {
tmp49 . level = "fatal" ;
obj1 = callback ( 817 ) ;
const result = obj1 . addExceptionMechanism ( closure _2 , { handled : false , type : "onerror" } ) ;
} else {
tmp49 . level = "error" ;
obj = callback ( 817 ) ;
const result1 = obj . addExceptionMechanism ( closure _2 , { handled : true , type : "generic" } ) ;
}
client . captureEvent ( closure _2 , obj2 ) ;
let num3 = client . getOptions ( ) . shutdownTimeout ;
if ( ! num3 ) {
num3 = 2000 ;
}
client . flush ( num3 ) . then ( ( ) => {
obj2 ( client , obj2 ) ;
} , ( arg0 ) => {
const debug = client ( obj2 [ 2 ] ) . debug ;
debug . error ( "[ReactNativeErrorHandlers] Error while flushing the event cache after uncaught error." , arg0 ) ;
} ) ;
c3 = 3 ;
2026-08-05 07:35:12 +00:00
return { value : "T" , done : null } ;
2026-07-29 08:29:29 +00:00
}
} catch ( tmp40 ) {
c3 = tmp ;
throw tmp40 ;
}
}
} ) ;
} ) ;
} else {
let debug = tmp3 ( tmp4 [ 2 ] ) . debug ;
debug . warn ( "ErrorUtils not found. Can be caused by different environment for example react-native-web." ) ;
}
tmp3 = obj ;
tmp4 = outer1 _1 ;
}
}
} ;
return obj ;
} ;