mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-03-26 07:04:05 +08:00
Added RCT_DEBUG
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
|
||||
#import "RCTExceptionsManager.h"
|
||||
|
||||
#import "RCTDefines.h"
|
||||
#import "RCTLog.h"
|
||||
#import "RCTRedBox.h"
|
||||
#import "RCTRootView.h"
|
||||
@@ -43,11 +44,10 @@ RCT_EXPORT_METHOD(reportUnhandledException:(NSString *)message
|
||||
return;
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
|
||||
[[RCTRedBox sharedInstance] showErrorMessage:message withStack:stack];
|
||||
|
||||
#else
|
||||
if (RCT_DEBUG) {
|
||||
[[RCTRedBox sharedInstance] showErrorMessage:message withStack:stack];
|
||||
return;
|
||||
}
|
||||
|
||||
static NSUInteger reloadRetries = 0;
|
||||
const NSUInteger maxMessageLength = 75;
|
||||
@@ -76,21 +76,14 @@ RCT_EXPORT_METHOD(reportUnhandledException:(NSString *)message
|
||||
NSString *name = [@"Unhandled JS Exception: " stringByAppendingString:sanitizedMessage];
|
||||
[NSException raise:name format:@"Message: %@, stack: %@", message, prettyStack];
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
RCT_EXPORT_METHOD(updateExceptionMessage:(NSString *)message
|
||||
stack:(NSArray *)stack)
|
||||
{
|
||||
|
||||
#if DEBUG
|
||||
|
||||
[[RCTRedBox sharedInstance] updateErrorMessage:message withStack:stack];
|
||||
|
||||
#endif
|
||||
|
||||
if (RCT_DEBUG) {
|
||||
[[RCTRedBox sharedInstance] updateErrorMessage:message withStack:stack];
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user