Skip to content

Commit ca5db2a

Browse files
committed
Restore previous value
1 parent 7c37bee commit ca5db2a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/index.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,14 @@ export default function catchErrors({ filename, components, imports }) {
1717
} catch (err) {
1818
setTimeout(() => {
1919
if (typeof console.reportErrorsAsExceptions !== 'undefined') {
20+
let prevReportErrorAsExceptions = console.reportErrorsAsExceptions;
2021
// We're in React Native. Don't throw.
2122
// Stop react-native from triggering its own error handler
2223
console.reportErrorsAsExceptions = false;
2324
// Log an error
2425
console.error(err);
2526
// Reactivate it so other errors are still handled
26-
console.reportErrorsAsExceptions = true;
27+
console.reportErrorsAsExceptions = prevReportErrorAsExceptions;
2728
} else {
2829
throw err;
2930
}

0 commit comments

Comments
 (0)