Skip to content

Commit 6cb12e0

Browse files
committed
Added support for console.error
1 parent 9b60fb2 commit 6cb12e0

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export const setJSExceptionHandler = (customHandler = noop, allowedInDevMode = f
99
const allowed = allowedInDevMode ? true : !__DEV__;
1010
if (allowed) {
1111
global.ErrorUtils.setGlobalHandler(customHandler);
12+
console.error = (message, error) => global.ErrorUtils.reportError(error); // sending console.error so that it can be caught
1213
} else {
1314
console.log('Skipping setJSExceptionHandler: Reason: In DEV mode and allowedInDevMode = false');
1415
}

ios/ReactNativeExceptionHandler.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Pod::Spec.new do |s|
33
s.name = "ReactNativeExceptionHandler"
44
s.summary = "A react native module that lets you to register a global error handler that can capture fatal/non fatal uncaught exceptions"
5-
s.version = "2.2.0"
5+
s.version = "2.3.0"
66
s.description = <<-DESC
77
A react native module that lets you to register a global error handler that can capture fatal/non fatal uncaught exceptions.
88
The module helps prevent abrupt crashing of RN Apps without a graceful message to the user.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-exception-handler",
3-
"version": "2.2.0",
3+
"version": "2.3.0",
44
"description": "A react native module that lets you to register a global error handler that can capture fatal/non fatal uncaught exceptions.",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)