mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-01-31 17:18:45 +08:00
[ReactNative] Make ErrorCookie work.
This commit is contained in:
@@ -25,13 +25,16 @@ type Exception = {
|
||||
message: string;
|
||||
}
|
||||
|
||||
var exceptionID = 0;
|
||||
|
||||
function reportException(e: Exception, isFatal: bool, stack?: any) {
|
||||
var currentExceptionID = ++exceptionID;
|
||||
if (RCTExceptionsManager) {
|
||||
if (!stack) {
|
||||
stack = parseErrorStack(e);
|
||||
}
|
||||
if (isFatal) {
|
||||
RCTExceptionsManager.reportFatalException(e.message, stack);
|
||||
RCTExceptionsManager.reportFatalException(e.message, stack, currentExceptionID);
|
||||
} else {
|
||||
RCTExceptionsManager.reportSoftException(e.message, stack);
|
||||
}
|
||||
@@ -39,7 +42,7 @@ function reportException(e: Exception, isFatal: bool, stack?: any) {
|
||||
(sourceMapPromise = sourceMapPromise || loadSourceMap())
|
||||
.then(map => {
|
||||
var prettyStack = parseErrorStack(e, map);
|
||||
RCTExceptionsManager.updateExceptionMessage(e.message, prettyStack);
|
||||
RCTExceptionsManager.updateExceptionMessage(e.message, prettyStack, currentExceptionID);
|
||||
})
|
||||
.catch(error => {
|
||||
// This can happen in a variety of normal situations, such as
|
||||
|
||||
Reference in New Issue
Block a user