Hisoka-X commented on code in PR #5948:
URL: https://github.com/apache/seatunnel/pull/5948#discussion_r1418478489


##########
seatunnel-formats/seatunnel-format-compatible-connect-json/src/main/java/org/apache/seatunnel/format/compatible/kafka/connect/json/CompatibleKafkaConnectDeserializationSchema.java:
##########
@@ -126,15 +127,13 @@ private SeaTunnelRow convertJsonNode(JsonNode jsonNode) {
         if (jsonNode.isNull()) {
             return null;
         }
+
         try {
             org.apache.seatunnel.shade.com.fasterxml.jackson.databind.JsonNode 
jsonData =
                     objectMapper.readTree(jsonNode.toString());
             return (SeaTunnelRow) runtimeConverter.convert(jsonData);
         } catch (Throwable t) {
-            throw new SeaTunnelJsonFormatException(
-                    CommonErrorCodeDeprecated.JSON_OPERATION_FAILED,
-                    String.format("Failed to deserialize JSON '%s'.", 
jsonNode),
-                    t);
+            throw mayThrow(t, () -> CommonError.jsonOperationError(FORMAT, 
jsonNode.toString(), t));

Review Comment:
   I think just use `throw CommonError.jsonOperationError(FORMAT, 
jsonNode.toString(), t)` should be fine. Because it contains sub error 
information and `CommonError.jsonOperationError` information. So I think skip 
`CommonError.jsonOperationError` and only return sub error not a good choice. 
Same to all other use `mayThrow`, please do not use it for now.



-- 
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]

Reply via email to