Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
)
}
if (process.env['ENVIRONMENT'] !== 'integration_test') {
// eslint-disable-next-line
if (!__DEV__) {
console.error = error => exceptionHandler(error, false)
}
if (Platform.OS === 'ios' || Platform.OS === 'android') {
const allowInDevMode = false
const forceAppQuit = false
const executeDefaultHandler = false
setJSExceptionHandler(exceptionHandler, allowInDevMode)
setNativeExceptionHandler(() => {}, forceAppQuit, executeDefaultHandler)
}
}
)
}
if (!isIntegrationMode) {
// eslint-disable-next-line
if (!__DEV__) {
console.error = error => exceptionHandler(error, false)
}
if (Platform.OS === 'ios' || Platform.OS === 'android') {
const allowInDevMode = false
const forceAppQuit = false
const executeDefaultHandler = false
setJSExceptionHandler(exceptionHandler, allowInDevMode)
setNativeExceptionHandler(() => {}, forceAppQuit, executeDefaultHandler)
}
}
],
{ cancelable: false }
)
}
if (!isIntegrationMode && Platform.OS !== 'web') {
if (!__DEV__) {
console.error = error => exceptionHandler(error, false)
}
const allowInDevMode = false
const forceAppQuit = false
const executeDefaultHandler = true
setJSExceptionHandler(exceptionHandler, allowInDevMode)
setNativeExceptionHandler(
() =>
Notifier.system({
title: I18n.t('restart'),
body: I18n.t('unexpected-error'),
}),
forceAppQuit,
executeDefaultHandler
)
}
React.useEffect(() => {
setJSExceptionHandler(errorHandler)
setNativeExceptionHandler(errorHandler)
}, [])
initializeErrorHandling = (store) => {
this.store = store;
initializeSentry();
setJSExceptionHandler(this.errorHandler, false);
setNativeExceptionHandler(this.nativeErrorHandler, false);
}