|
|
@@ -15,7 +15,9 @@
|
|
15
|
15
|
*/
|
|
16
|
16
|
|
|
17
|
17
|
#import <React/RCTAssert.h>
|
|
|
18
|
+#import <React/RCTLog.h>
|
|
18
|
19
|
|
|
|
20
|
+#import "LogUtils.h"
|
|
19
|
21
|
#import "ReactUtils.h"
|
|
20
|
22
|
|
|
21
|
23
|
#pragma mark - Utility functions
|
|
|
@@ -67,19 +69,11 @@ NSMutableDictionary* mergeProps(NSDictionary *a, NSDictionary *b) {
|
|
67
|
69
|
*/
|
|
68
|
70
|
RCTFatalHandler _RCTFatal = ^(NSError *error) {
|
|
69
|
71
|
id jsStackTrace = error.userInfo[RCTJSStackTraceKey];
|
|
70
|
|
- @try {
|
|
71
|
|
- NSString *name
|
|
72
|
|
- = [NSString stringWithFormat:@"%@: %@",
|
|
73
|
|
- RCTFatalExceptionName,
|
|
74
|
|
- error.localizedDescription];
|
|
75
|
|
- NSString *message
|
|
76
|
|
- = RCTFormatError(error.localizedDescription, jsStackTrace, 75);
|
|
77
|
|
- [NSException raise:name format:@"%@", message];
|
|
78
|
|
- } @catch (NSException *e) {
|
|
79
|
|
- if (!jsStackTrace) {
|
|
80
|
|
- @throw;
|
|
81
|
|
- }
|
|
82
|
|
- }
|
|
|
72
|
+ NSString *name
|
|
|
73
|
+ = [NSString stringWithFormat:@"%@: %@", RCTFatalExceptionName, error.localizedDescription];
|
|
|
74
|
+ NSString *message
|
|
|
75
|
+ = RCTFormatError(error.localizedDescription, jsStackTrace, -1);
|
|
|
76
|
+ DDLogError(@"FATAL ERROR: %@\n%@", name, message);
|
|
83
|
77
|
};
|
|
84
|
78
|
|
|
85
|
79
|
/**
|