TyrantLucifer commented on code in PR #3593:
URL:
https://github.com/apache/incubator-seatunnel/pull/3593#discussion_r1036605848
##########
seatunnel-connectors-v2/connector-starrocks/src/main/java/org/apache/seatunnel/connectors/seatunnel/starrocks/sink/StarRocksSinkWriter.java:
##########
@@ -84,6 +86,6 @@ public static StarRocksISerializer
createSerializer(SinkConfig sinkConfig, SeaTu
if
(SinkConfig.StreamLoadFormat.JSON.equals(sinkConfig.getLoadFormat())) {
return new StarRocksJsonSerializer(seaTunnelRowType);
}
- throw new RuntimeException("Failed to create row serializer,
unsupported `format` from stream load properties.");
+ throw new
StarRocksConnectorException(CommonErrorCode.SERIALIZE_OPERATION_FAILED, "Failed
to create row serializer, unsupported `format` from stream load properties.");
Review Comment:
CommonErrorCode.ILLEGAL_ARGUMENT is better
##########
seatunnel-connectors-v2/connector-starrocks/src/main/java/org/apache/seatunnel/connectors/seatunnel/starrocks/client/StarRocksSinkManager.java:
##########
@@ -116,10 +119,10 @@ public synchronized void flush() throws IOException {
} catch (Exception e) {
log.warn("Writing records to StarRocks failed, retry times =
{}", i, e);
if (i >= sinkConfig.getMaxRetries()) {
- throw new IOException("Writing records to StarRocks
failed.", e);
+ throw new
StarRocksConnectorException(StarRocksConnectorErrorCode.WRITE_RECORDS_FAILED,
"Writing records to StarRocks failed.", e);
Review Comment:
throw new
StarRocksConnectorException(StarRocksConnectorErrorCode.WRITE_RECORDS_FAILED,
"The number of retries was exceeded, writing records to StarRocks failed.", e)
--
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]