Skip to content

Commit

Permalink
Added support for console.error
Browse files Browse the repository at this point in the history
  • Loading branch information
a7ul committed Sep 20, 2017
1 parent 9b60fb2 commit 6cb12e0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
Expand Down
2 changes: 1 addition & 1 deletion ios/ReactNativeExceptionHandler.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down

0 comments on commit 6cb12e0

Please sign in to comment.