[ReactNative] orange box

Summary:
@public

There have been multiple instances of confusion about whether a redbox means the
developer did something they shouldn't but things will keep working, or if
something went horribly wrong and the app will crash in prod.  This diff
introduces an orange background color to the redbox for `console.error` and
`RCTLogError` to indicate that something bad happened, but that the app will
continue working.

Test Plan:
see orange error for geo permissions:

{F22541375}
This commit is contained in:
Spencer Ahrens
2015-06-09 14:51:25 -07:00
parent 6358e163a5
commit 68bb3a7e71
4 changed files with 23 additions and 3 deletions

View File

@@ -44,7 +44,9 @@ RCT_EXPORT_METHOD(reportSoftException:(NSString *)message
[_delegate handleSoftJSExceptionWithMessage:message stack:stack];
return;
}
// JS already logs the error via console.
RCTRedBox *box = [RCTRedBox sharedInstance];
[box setNextBackgroundColor:[UIColor colorWithRed:0.9 green:0.4 blue:0.2 alpha:1]];
[box showErrorMessage:message withStack:stack];
}
RCT_EXPORT_METHOD(reportFatalException:(NSString *)message