mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Reuse preprocessed exception message in redbox after symbolication
Summary: Reuse preprocessed exception message when sending the symbolicated update to the redbox, in case `preprocessException` has actually modified it. Reviewed By: cpojer Differential Revision: D17318008 fbshipit-source-id: 8b4c606c662140fb44c5305e2f3c7faa0b60f0ee
This commit is contained in:
committed by
Facebook Github Bot
parent
e54ecf907e
commit
5789e67760
@@ -81,23 +81,23 @@ function reportException(e: ExtendedError, isFatal: boolean) {
|
||||
message =
|
||||
e.jsEngine == null ? message : `${message}, js engine: ${e.jsEngine}`;
|
||||
|
||||
NativeExceptionsManager.reportException(
|
||||
preprocessException({
|
||||
message,
|
||||
originalMessage: message === originalMessage ? null : originalMessage,
|
||||
name: e.name == null || e.name === '' ? null : e.name,
|
||||
componentStack:
|
||||
typeof e.componentStack === 'string' ? e.componentStack : null,
|
||||
stack,
|
||||
id: currentExceptionID,
|
||||
isFatal,
|
||||
extraData: {
|
||||
jsEngine: e.jsEngine,
|
||||
rawStack: e.stack,
|
||||
framesPopped: e.framesToPop,
|
||||
},
|
||||
}),
|
||||
);
|
||||
const data = preprocessException({
|
||||
message,
|
||||
originalMessage: message === originalMessage ? null : originalMessage,
|
||||
name: e.name == null || e.name === '' ? null : e.name,
|
||||
componentStack:
|
||||
typeof e.componentStack === 'string' ? e.componentStack : null,
|
||||
stack,
|
||||
id: currentExceptionID,
|
||||
isFatal,
|
||||
extraData: {
|
||||
jsEngine: e.jsEngine,
|
||||
rawStack: e.stack,
|
||||
framesPopped: e.framesToPop,
|
||||
},
|
||||
});
|
||||
|
||||
NativeExceptionsManager.reportException(data);
|
||||
|
||||
if (__DEV__) {
|
||||
if (e.preventSymbolication === true) {
|
||||
@@ -111,7 +111,7 @@ function reportException(e: ExtendedError, isFatal: boolean) {
|
||||
frame => !frame.collapse,
|
||||
);
|
||||
NativeExceptionsManager.updateExceptionMessage(
|
||||
message,
|
||||
data.message,
|
||||
stackWithoutCollapsedFrames,
|
||||
currentExceptionID,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user