Hisoka-X commented on code in PR #5919:
URL: https://github.com/apache/seatunnel/pull/5919#discussion_r1405587409
##########
seatunnel-formats/seatunnel-format-json/src/main/java/org/apache/seatunnel/format/json/ogg/OggJsonDeserializationSchema.java:
##########
@@ -102,7 +102,7 @@ public OggJsonDeserializationSchema(
@Override
public SeaTunnelRow deserialize(byte[] message) throws IOException {
throw new SeaTunnelJsonFormatException(
- CommonErrorCodeDeprecated.JSON_OPERATION_FAILED,
+ CommonErrorCode.JSON_OPERATION_FAILED,
String.format("Failed to deserialize JSON '%s'.", new
String(message)));
}
Review Comment:
I think you should create a method in `CommonError` to create
`SeaTunnelRunTimeException` with `CommonErrorCode.JSON_OPERATION_FAILED` just
like other exception. Then throw exception by `throw
CommonError.jsonOperationFailed(content)`; Do not throw new `CommonErrorCode`
with such way.
##########
seatunnel-common/src/main/java/org/apache/seatunnel/common/exception/CommonErrorCode.java:
##########
@@ -19,6 +19,7 @@
/** SeaTunnel connector error code interface */
public enum CommonErrorCode implements SeaTunnelErrorCode {
+ JSON_OPERATION_FAILED("COMMON-02", "Json covert/parse operation failed"),
Review Comment:
The error message should more information like `the operation json string`.
```
"Json covert/parse operation failed" => "Json <content> covert/parse
operation failed"
```
--
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]