Skip to content

Commit d9b5404

Browse files
committed
Rethrow in dev, do not otherwise
1 parent c20a5a4 commit d9b5404

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

plugins/react-native.js

+6-3
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@
1212
* pathStrip: A RegExp that matches the portions of a file URI that should be
1313
* removed from stacks prior to submission.
1414
*
15-
* noRethrow: Pass true if you DO NOT wish for Raven to call the original
16-
* global exception handler (e.g. don't crash the app).
15+
* rethrow: Pass true if you wish for Raven to call the original global
16+
* exception handler (e.g. don't crash the app or show the redbox).
17+
* Default behavior is to rethrow in dev (for redbox), and NOT to rethrow
18+
* (keeping the app alive after a JS exception).
1719
*/
1820
'use strict';
1921

@@ -85,9 +87,10 @@ function reactNativePlugin(Raven, pluginOptions) {
8587

8688
var defaultHandler = ErrorUtils.getGlobalHandler && ErrorUtils.getGlobalHandler() || ErrorUtils._globalHandler;
8789

90+
var rethrow = pluginOptions.rethrow || __DEV__;
8891
ErrorUtils.setGlobalHandler(function(){
8992
var error = arguments[0];
90-
if (!pluginOptions.noRethrow) {
93+
if (rethrow) {
9194
defaultHandler.apply(this, arguments)
9295
}
9396
Raven.captureException(error);

0 commit comments

Comments
 (0)