zhjwpku commented on code in PR #95:
URL: https://github.com/apache/iceberg-cpp/pull/95#discussion_r2083671354


##########
src/iceberg/json_internal.cc:
##########
@@ -1210,11 +1216,11 @@ Result<std::unique_ptr<TableMetadata>> 
TableMetadataFromJson(const nlohmann::jso
 }
 
 Result<nlohmann::json> FromJsonString(const std::string& json_string) {
-  try {
-    return nlohmann::json::parse(json_string);
-  } catch (const std::exception& e) {
-    return JsonParseError("Failed to parse JSON string: {}", e.what());
+  auto json = nlohmann::json::parse(json_string, nullptr, false);
+  if (json.is_discarded()) {

Review Comment:
   done



##########
src/iceberg/json_internal.cc:
##########
@@ -1210,11 +1216,11 @@ Result<std::unique_ptr<TableMetadata>> 
TableMetadataFromJson(const nlohmann::jso
 }
 
 Result<nlohmann::json> FromJsonString(const std::string& json_string) {
-  try {
-    return nlohmann::json::parse(json_string);
-  } catch (const std::exception& e) {
-    return JsonParseError("Failed to parse JSON string: {}", e.what());
+  auto json = nlohmann::json::parse(json_string, nullptr, false);

Review Comment:
   done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to