From 9a7e4b4902ffc733faa0facf86e9ceacd9f3f6a9 Mon Sep 17 00:00:00 2001 From: leeight Date: Wed, 5 Oct 2016 04:34:21 -0700 Subject: [PATCH] Dump invalid json when call Value::fromJSON failed Summary: See #9117 Closes https://github.com/facebook/react-native/pull/10231 Differential Revision: D3974063 Pulled By: javache fbshipit-source-id: 63d3ae02ae731cd5a63fcb3a645c612c57cbb8b4 --- ReactCommon/cxxreact/Value.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReactCommon/cxxreact/Value.cpp b/ReactCommon/cxxreact/Value.cpp index 6dc57e1c2..cc22bbb81 100644 --- a/ReactCommon/cxxreact/Value.cpp +++ b/ReactCommon/cxxreact/Value.cpp @@ -53,7 +53,7 @@ std::string Value::toJSONString(unsigned indent) const { Value Value::fromJSON(JSContextRef ctx, const String& json) { auto result = JSValueMakeFromJSONString(ctx, json); if (!result) { - throwJSExecutionException("Failed to create String from JSON"); + throwJSExecutionException("Failed to create String from JSON: %s", json.str().c_str()); } return Value(ctx, result); }