From 920632cadb108ceeacad93e9316e706608df2942 Mon Sep 17 00:00:00 2001 From: Moti Zilberman Date: Fri, 3 May 2019 12:15:52 -0700 Subject: [PATCH] Reuse message when updating redbox with symbolicated JS error Summary: On iOS, `RCTRedBox` will not update the displayed stack trace if the message string sent with the update differs from the original error message. As JS errors are shown in two stages - before and after symbolication - there was previously a case where the message would differ between the two `updateExceptionMessage` calls, blocking the update and leaving only the unsymbolicated trace visible. This diff fixes that. Longer term, we should also change `RCTRedBox`'s logic to rely on the JS-provided `exceptionID` instead of the message string - similar to what we do on Android. Changelog: [iOS] [Fixed] - Fix redbox JS symbolication when adding JS engine tag to the message Reviewed By: sahrens Differential Revision: D15202524 fbshipit-source-id: 237fc090e88b0c609865e0aed842d6a609c1239a --- Libraries/Core/ExceptionsManager.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Libraries/Core/ExceptionsManager.js b/Libraries/Core/ExceptionsManager.js index dfc41cd155ac94..4552306b490c2d 100644 --- a/Libraries/Core/ExceptionsManager.js +++ b/Libraries/Core/ExceptionsManager.js @@ -49,7 +49,7 @@ function reportException(e: ExtendedError, isFatal: boolean) { frame => frame.file.match(INTERNAL_CALLSITES_REGEX) === null, ); ExceptionsManager.updateExceptionMessage( - e.message, + message, stackWithoutInternalCallsites, currentExceptionID, );