From d3f9f88860f2db8eb5b5269b0e5a1a23abca4eec Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Mon, 1 Jul 2019 10:14:32 -0700 Subject: [PATCH] Show correct error message on initial load Summary: This fixes an issue that caused us to show a confusing message on the initial load. I guess at some point the field was renamed. The code falls back to the "generic" message if it can't parse JSON, and in this case, it couldn't find the field called `description` as it's now called `message`. Reviewed By: cpojer Differential Revision: D16073931 fbshipit-source-id: a70ae28635b72f674cb1da26f89744b4214f18d9 --- .../java/com/facebook/react/common/DebugServerException.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/common/DebugServerException.java b/ReactAndroid/src/main/java/com/facebook/react/common/DebugServerException.java index 6c84a9bbc6..dd82b0b451 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/common/DebugServerException.java +++ b/ReactAndroid/src/main/java/com/facebook/react/common/DebugServerException.java @@ -69,7 +69,7 @@ public class DebugServerException extends RuntimeException { JSONObject jsonObject = new JSONObject(str); String fullFileName = jsonObject.getString("filename"); return new DebugServerException( - jsonObject.getString("description"), + jsonObject.getString("message"), shortenFileName(fullFileName), jsonObject.getInt("lineNumber"), jsonObject.getInt("column"));