Add exception description to exception name
Reviewed By: fkgozali Differential Revision: D2687906 fb-gh-sync-id: f1bbc7c3deb9068877add37619faee730cdec743
This commit is contained in:
parent
e49c70026a
commit
b40631d0db
|
@ -128,8 +128,9 @@ void RCTFatal(NSError *error)
|
|||
#if DEBUG
|
||||
@try {
|
||||
#endif
|
||||
NSString *name = [NSString stringWithFormat:@"%@: %@", RCTFatalExceptionName, [error localizedDescription]];
|
||||
NSString *message = RCTFormatError([error localizedDescription], error.userInfo[RCTJSStackTraceKey], 75);
|
||||
[NSException raise:RCTFatalExceptionName format:@"%@", message];
|
||||
[NSException raise:name format:@"%@", message];
|
||||
#if DEBUG
|
||||
} @catch (NSException *e) {}
|
||||
#endif
|
||||
|
@ -160,5 +161,5 @@ NSString *RCTFormatError(NSString *message, NSArray<NSDictionary<NSString *, id>
|
|||
}
|
||||
}
|
||||
|
||||
return [NSString stringWithFormat:@"Message: %@%@", message, prettyStack];
|
||||
return [NSString stringWithFormat:@"%@%@", message, prettyStack];
|
||||
}
|
||||
|
|
|
@ -780,7 +780,7 @@ RCT_NOT_IMPLEMENTED(- (instancetype)initWithBundleURL:(__unused NSURL *)bundleUR
|
|||
}
|
||||
@catch (NSException *exception) {
|
||||
// Pass on JS exceptions
|
||||
if ([exception.name isEqualToString:RCTFatalExceptionName]) {
|
||||
if ([exception.name hasPrefix:RCTFatalExceptionName]) {
|
||||
@throw exception;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue