TaoZex commented on code in PR #3593:
URL:
https://github.com/apache/incubator-seatunnel/pull/3593#discussion_r1033747327
##########
docs/en/connector-v2/Error-Quick-Reference-Manual.md:
##########
@@ -144,6 +145,7 @@ problems encountered by users.
| IOTDB-02 | Initialize IoTDB client failed | When
the user encounters this error code, it indicates that the client
initialization failed. Please check |
| IOTDB-03 | Close IoTDB client failed | When
the user encounters this error code, it indicates that closing the client
failed. Please check |
+
Review Comment:
Remove
##########
seatunnel-connectors-v2/connector-starrocks/src/main/java/org/apache/seatunnel/connectors/seatunnel/starrocks/client/StarRocksStreamLoadVisitor.java:
##########
@@ -165,12 +167,12 @@ private void checkLabelState(String host, String label)
throws IOException {
String queryLoadStateUrl = new
StringBuilder(host).append("/api/").append(sinkConfig.getDatabase()).append("/get_load_state?label=").append(label).toString();
Map<String, Object> result =
httpHelper.doHttpGet(queryLoadStateUrl, getLoadStateHttpHeader(label));
if (result == null) {
- throw new IOException(String.format("Failed to flush data
to StarRocks, Error " +
+ throw new
StarRocksConnectorException(CommonErrorCode.ILLEGAL_ARGUMENT,
String.format("Failed to flush data to StarRocks, Error " +
"could not get the final state of label[%s].\n",
label), null);
}
String labelState = (String) result.get("state");
if (null == labelState) {
- throw new IOException(String.format("Failed to flush data
to StarRocks, Error " +
+ throw new
StarRocksConnectorException(CommonErrorCode.ILLEGAL_ARGUMENT,
String.format("Failed to flush data to StarRocks, Error " +
Review Comment:
Same as above.
##########
seatunnel-connectors-v2/connector-starrocks/src/main/java/org/apache/seatunnel/connectors/seatunnel/starrocks/client/StarRocksStreamLoadVisitor.java:
##########
@@ -165,12 +167,12 @@ private void checkLabelState(String host, String label)
throws IOException {
String queryLoadStateUrl = new
StringBuilder(host).append("/api/").append(sinkConfig.getDatabase()).append("/get_load_state?label=").append(label).toString();
Map<String, Object> result =
httpHelper.doHttpGet(queryLoadStateUrl, getLoadStateHttpHeader(label));
if (result == null) {
- throw new IOException(String.format("Failed to flush data
to StarRocks, Error " +
+ throw new
StarRocksConnectorException(CommonErrorCode.ILLEGAL_ARGUMENT,
String.format("Failed to flush data to StarRocks, Error " +
Review Comment:
Why use CommonErrorCode.ILLEGAL_ARGUMENT?
##########
seatunnel-connectors-v2/connector-starrocks/src/main/java/org/apache/seatunnel/connectors/seatunnel/starrocks/sink/StarRocksSinkWriter.java:
##########
@@ -73,7 +75,7 @@ public void close() throws IOException {
}
} catch (IOException e) {
log.error("Close starRocks manager failed.", e);
- throw new IOException("Close starRocks manager failed.", e);
+ throw new
StarRocksConnectorException(CommonErrorCode.SQL_OPERATION_FAILED, e);
Review Comment:
Close manage failures have nothing to do with SQL, and it is better to
define the associated error code.
##########
docs/en/connector-v2/Error-Quick-Reference-Manual.md:
##########
@@ -89,6 +89,7 @@ problems encountered by users.
|----------------|---------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------|
| TABLESTORE-01 | Failed to send these rows of data | When users
encounter this error code, it means that failed to write these rows of data,
please check the rows that failed to import |
+
Review Comment:
Remove
--
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]