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
This commit is contained in:
leeight 2016-10-05 04:34:21 -07:00 committed by Facebook Github Bot
parent fb355f663d
commit 9a7e4b4902
1 changed files with 1 additions and 1 deletions

View File

@ -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);
}