Skip to content

Commit 1fed2cf

Browse files
RSNarafacebook-github-bot
authored andcommitted
bugfix: Only handle first javascript fatal error (facebook#47914)
Summary: Pull Request resolved: facebook#47914 This was a bug in the original diff: D66193194. If a fatal js error happens, we should only drop subsequent **fatal** js errors. It's fine to report soft errors. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D66392706 fbshipit-source-id: c51bae186184c54faa9bce065b81b442607e751b
1 parent 5dd712f commit 1fed2cf

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/react-native/ReactCommon/jserrorhandler/JsErrorHandler.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,11 +379,14 @@ void JsErrorHandler::handleErrorWithCppPipeline(
379379
}
380380
}
381381

382-
if (*shouldPreventDefault || _hasHandledFatalError) {
382+
if (*shouldPreventDefault) {
383383
return;
384384
}
385385

386386
if (isFatal) {
387+
if (_hasHandledFatalError) {
388+
return;
389+
}
387390
_hasHandledFatalError = true;
388391
}
389392

0 commit comments

Comments
 (0)