Commit Graph

6 Commits

Author SHA1 Message Date
Paige Sun 5449148482 4/n Display a RedBox with the JS stack (instead of native stack) when an unhandled JS exceptions occurs - Try 2
Summary:
Changelog: [iOS][Changed] Display a RedBox with the JS stack (instead of native stack) when an unhandled JS exceptions occurs

-----

# A0) Bridge mode, Unhandled Exception, FBiOS
Unhandled exception goes to FBReactModule, but the JS Stack is not parsed correctly.
https://www.internalfb.com/code/fbsource/[312d5cbdd7278247a84619786b12a44c4400fcc0]/fbobjc/Apps/Wilde/FBReactModule2/FBReactModuleAPI/FBReactModuleAPI/Exported/FBReactModule.mm?lines=1488%2C1493

See `****** FBReactModule handleFatalError` in the logs P539306390, and compare with correct behavior in (A1) in the Test Plan.

https://pxl.cl/2h6h3

{F782257996}

-----

# A) Before diff, rn-tester
Open to rn-tester -> APIs -> Crash Examples -> JS Crash.

Set `RCTParseUnhandledJSErrorStackNatively` to YES.
https://www.internalfb.com/code/fbsource/[98880e52ee78be3614e5d9a2ce3292f6a7b5e413]/xplat/js/react-native-github/React/Base/RCTConstants.m?lines=73

{F783395297}

----

build_on_commit[ios_fbios-arm64-dylibs-jackalope-iphoneos-production_build]

Reviewed By: RSNara

Differential Revision: D40613108

fbshipit-source-id: f36c3b39a2167402ee3730db8b40b53a0b80aa60
2022-10-23 16:42:00 -07:00
Donald Webster 9e68eea2c8 Revert D40387938: 4/n Display a RedBox with the JS stack (instead of native stack) when an unhandled JS exceptions occurs
Differential Revision:
D40387938 (https://github.com/facebook/react-native/commit/ff398e4e2632ece8a6f22d744e96e489ca3b9d92)

Original commit changeset: 2abea657476d

Original Phabricator Diff: D40387938 (https://github.com/facebook/react-native/commit/ff398e4e2632ece8a6f22d744e96e489ca3b9d92)

fbshipit-source-id: 0b5dbe417abf25d5723c70337189dfb42570e56d
2022-10-21 12:59:54 -07:00
Paige Sun ff398e4e26 4/n Display a RedBox with the JS stack (instead of native stack) when an unhandled JS exceptions occurs
Summary:
Changelog: [iOS][Changed] Display a RedBox with the JS stack (instead of native stack) when an unhandled JS exceptions occurs

-----

# A0) Bridge mode, Unhandled Exception, FBiOS
Unhandled exception goes to FBReactModule, but the JS Stack is not parsed correctly.
https://www.internalfb.com/code/fbsource/[312d5cbdd7278247a84619786b12a44c4400fcc0]/fbobjc/Apps/Wilde/FBReactModule2/FBReactModuleAPI/FBReactModuleAPI/Exported/FBReactModule.mm?lines=1488%2C1493

See `****** FBReactModule handleFatalError` in the logs P539306390, and compare with correct behavior in (A1) in the Test Plan.

https://pxl.cl/2h6h3

{F782257996}

-----

# A) Before diff, rn-tester
Open to rn-tester -> APIs -> Crash Examples -> JS Crash.

Set `RCTParseUnhandledJSErrorStackNatively` to YES.
https://www.internalfb.com/code/fbsource/[98880e52ee78be3614e5d9a2ce3292f6a7b5e413]/xplat/js/react-native-github/React/Base/RCTConstants.m?lines=73

{F783395297}

Reviewed By: sammy-SC

Differential Revision: D40387938

fbshipit-source-id: 2abea657476d3bf61ad5b1c643f129e44c6f3f35
2022-10-20 21:12:41 -07:00
Lulu Wu be6f65660f Add "EarlyJsError: " as prefix of early js error's message
Summary:
Changelog:
[General][Changed] - Add "EarlyJsError: " as prefix of early js error's message

Reviewed By: RSNara

Differential Revision: D40484148

fbshipit-source-id: 4c8f9b4a35c7547365bd70dff7627a08a0e6bc4b
2022-10-20 03:22:25 -07:00
Paige Sun 20c9654ca7 2/n Code clarity: Use enum to clarify the values parsed by JsErrorHandler
Summary:
Changelog: [Internal] Code clarity: Use enum to clarify the values parsed by JsErrorHandler

Create a enum `JSErrorHandlerKey` to define the keys for the values that goes into each stack frame.

Next up -- using this in the Bridge!

Reviewed By: sammy-SC

Differential Revision: D40326127

fbshipit-source-id: e416814fbcaa922afa92d9baf79eaa898ff979f0
2022-10-14 10:48:47 -07:00
Paige Sun 84225573c1 1/n Add new JsErrorHandler buck target to parse JS errors in C++
Summary:
Changelog: [Internal][Added] 1/n Add new JsErrorHandler buck target to parse JS errors in C++

This JsErrorHandler.cpp class uses the same regex logic as [stack-trace-parser.js](https://github.com/errwischt/stacktrace-parser/blob/master/src/stack-trace-parser.js#L121) in order to parse JS errors into an array of stack frames.

In RN, stacktrace-parser is called from [Devtools/parseErrorStack.js](https://github.com/facebook/react-native/blob/8bd3edec88148d0ab1f225d2119435681fbbba33/Libraries/Core/Devtools/parseErrorStack.js#L46).

Reviewed By: sammy-SC

Differential Revision: D40296024

fbshipit-source-id: 8e1b034e8a1ee1a8cc808bfc36c7104a8f40f9cc
2022-10-13 21:40:08 -07:00