diff --git a/index.js b/index.js index eba7bf2..e87988b 100644 --- a/index.js +++ b/index.js @@ -9,6 +9,7 @@ export const setJSExceptionHandler = (customHandler = noop, allowedInDevMode = f const allowed = allowedInDevMode ? true : !__DEV__; if (allowed) { global.ErrorUtils.setGlobalHandler(customHandler); + console.error = (message, error) => global.ErrorUtils.reportError(error); // sending console.error so that it can be caught } else { console.log('Skipping setJSExceptionHandler: Reason: In DEV mode and allowedInDevMode = false'); } diff --git a/ios/ReactNativeExceptionHandler.podspec b/ios/ReactNativeExceptionHandler.podspec index 34aaea0..305724b 100644 --- a/ios/ReactNativeExceptionHandler.podspec +++ b/ios/ReactNativeExceptionHandler.podspec @@ -2,7 +2,7 @@ Pod::Spec.new do |s| s.name = "ReactNativeExceptionHandler" s.summary = "A react native module that lets you to register a global error handler that can capture fatal/non fatal uncaught exceptions" - s.version = "2.2.0" + s.version = "2.3.0" s.description = <<-DESC A react native module that lets you to register a global error handler that can capture fatal/non fatal uncaught exceptions. The module helps prevent abrupt crashing of RN Apps without a graceful message to the user. diff --git a/package.json b/package.json index 0d5512b..e7d3e4d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-exception-handler", - "version": "2.2.0", + "version": "2.3.0", "description": "A react native module that lets you to register a global error handler that can capture fatal/non fatal uncaught exceptions.", "main": "index.js", "scripts": {