Show redbox window on JS errors for debug builds
Reviewed By: javache Differential Revision: D4860613 fbshipit-source-id: 255202df9401ffd1dfb48224dd89255eac76874e
This commit is contained in:
parent
cb88df00ae
commit
abd148fa21
|
@ -368,7 +368,9 @@ RCT_EXPORT_MODULE()
|
||||||
|
|
||||||
- (void)showError:(NSError *)error
|
- (void)showError:(NSError *)error
|
||||||
{
|
{
|
||||||
[self showErrorMessage:error.localizedDescription withDetails:error.localizedFailureReason];
|
[self showErrorMessage:error.localizedDescription
|
||||||
|
withDetails:error.localizedFailureReason
|
||||||
|
stack:error.userInfo[RCTJSStackTraceKey]];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)showErrorMessage:(NSString *)message
|
- (void)showErrorMessage:(NSString *)message
|
||||||
|
@ -378,11 +380,15 @@ RCT_EXPORT_MODULE()
|
||||||
|
|
||||||
- (void)showErrorMessage:(NSString *)message withDetails:(NSString *)details
|
- (void)showErrorMessage:(NSString *)message withDetails:(NSString *)details
|
||||||
{
|
{
|
||||||
|
[self showErrorMessage:message withDetails:details stack:nil];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)showErrorMessage:(NSString *)message withDetails:(NSString *)details stack:(NSArray<id> *)stack {
|
||||||
NSString *combinedMessage = message;
|
NSString *combinedMessage = message;
|
||||||
if (details) {
|
if (details) {
|
||||||
combinedMessage = [NSString stringWithFormat:@"%@\n\n%@", message, details];
|
combinedMessage = [NSString stringWithFormat:@"%@\n\n%@", message, details];
|
||||||
}
|
}
|
||||||
[self showErrorMessage:combinedMessage withStack:nil isUpdate:NO];
|
[self showErrorMessage:combinedMessage withStack:stack isUpdate:NO];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)showErrorMessage:(NSString *)message withRawStack:(NSString *)rawStack
|
- (void)showErrorMessage:(NSString *)message withRawStack:(NSString *)rawStack
|
||||||
|
|
Loading…
Reference in New Issue