File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed
Libraries/JavaScriptAppEngine/Initialization Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -25,21 +25,24 @@ type Exception = {
2525 message: string ;
2626}
2727
28+ var exceptionID = 0 ;
29+
2830function reportException ( e : Exception , isFatal : bool , stack ?: any ) {
31+ var currentExceptionID = ++ exceptionID ;
2932 if ( RCTExceptionsManager ) {
3033 if ( ! stack ) {
3134 stack = parseErrorStack ( e ) ;
3235 }
3336 if ( isFatal ) {
34- RCTExceptionsManager . reportFatalException ( e . message , stack ) ;
37+ RCTExceptionsManager . reportFatalException ( e . message , stack , currentExceptionID ) ;
3538 } else {
3639 RCTExceptionsManager . reportSoftException ( e . message , stack ) ;
3740 }
3841 if ( __DEV__ ) {
3942 ( sourceMapPromise = sourceMapPromise || loadSourceMap ( ) )
4043 . then ( map => {
4144 var prettyStack = parseErrorStack ( e , map ) ;
42- RCTExceptionsManager . updateExceptionMessage ( e . message , prettyStack ) ;
45+ RCTExceptionsManager . updateExceptionMessage ( e . message , prettyStack , currentExceptionID ) ;
4346 } )
4447 . catch ( error => {
4548 // This can happen in a variety of normal situations, such as
Original file line number Diff line number Diff line change @@ -48,7 +48,8 @@ - (instancetype)init
4848}
4949
5050RCT_EXPORT_METHOD (reportFatalException:(NSString *)message
51- stack:(NSArray *)stack)
51+ stack:(NSArray *)stack
52+ exceptionId:(__unused NSNumber *)exceptionId)
5253{
5354 if (_delegate) {
5455 [_delegate handleFatalJSExceptionWithMessage: message stack: stack];
@@ -86,7 +87,8 @@ - (instancetype)init
8687}
8788
8889RCT_EXPORT_METHOD (updateExceptionMessage:(NSString *)message
89- stack:(NSArray *)stack)
90+ stack:(NSArray *)stack
91+ exceptionId:(__unused NSNumber *)exceptionId)
9092{
9193 if (_delegate) {
9294 [_delegate updateJSExceptionWithMessage: message stack: stack];
@@ -100,6 +102,6 @@ - (instancetype)init
100102RCT_EXPORT_METHOD (reportUnhandledException:(NSString *)message
101103 stack:(NSArray *)stack)
102104{
103- [self reportFatalException: message stack: stack];
105+ [self reportFatalException: message stack: stack exceptionId: nil ];
104106}
105107@end
You can’t perform that action at this time.
0 commit comments