TyrantLucifer commented on code in PR #3598:
URL: 
https://github.com/apache/incubator-seatunnel/pull/3598#discussion_r1035490308


##########
seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/exception/JdbcConnectorErrorCode.java:
##########
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.seatunnel.connectors.seatunnel.jdbc.exception;
+
+import org.apache.seatunnel.common.exception.SeaTunnelErrorCode;
+
+public enum JdbcConnectorErrorCode implements SeaTunnelErrorCode {
+
+    CREATE_DRIVER_FAILED("JDBC-01", "Fail to create driver of class"),
+    NO_SUITABLE_DRIVER("JDBC-02", "No suitable driver found"),
+    SQL_OPERATION_FAILED("JDBC-03", "Sql operation failed, such as 
(execute,addBatch,close) etc..."),
+    XA_EXCEPTION("JDBC-04", "Xa operation failed, such as (commit, rollback) 
etc.."),

Review Comment:
   ```suggestion
       XA_OPERATION_FAILED("JDBC-04", "Xa operation failed, such as (commit, 
rollback) etc.."),
   ```



##########
seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/exception/JdbcConnectorErrorCode.java:
##########
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.seatunnel.connectors.seatunnel.jdbc.exception;
+
+import org.apache.seatunnel.common.exception.SeaTunnelErrorCode;
+
+public enum JdbcConnectorErrorCode implements SeaTunnelErrorCode {
+
+    CREATE_DRIVER_FAILED("JDBC-01", "Fail to create driver of class"),
+    NO_SUITABLE_DRIVER("JDBC-02", "No suitable driver found"),
+    SQL_OPERATION_FAILED("JDBC-03", "Sql operation failed, such as 
(execute,addBatch,close) etc..."),

Review Comment:
   Remove useless error code.



##########
seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/exception/JdbcConnectorErrorCode.java:
##########
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.seatunnel.connectors.seatunnel.jdbc.exception;
+
+import org.apache.seatunnel.common.exception.SeaTunnelErrorCode;
+
+public enum JdbcConnectorErrorCode implements SeaTunnelErrorCode {
+
+    CREATE_DRIVER_FAILED("JDBC-01", "Fail to create driver of class"),
+    NO_SUITABLE_DRIVER("JDBC-02", "No suitable driver found"),
+    SQL_OPERATION_FAILED("JDBC-03", "Sql operation failed, such as 
(execute,addBatch,close) etc..."),
+    XA_EXCEPTION("JDBC-04", "Xa operation failed, such as (commit, rollback) 
etc.."),
+    CONNECT_DATABASE_FAILED("JDBC-05", "Connector database failed"),
+    NULL_POINTER("JDBC-06", "Null pointer failed"),
+    EXCEPTION("JDBC-07", "transaction operation failed, such as (commit, 
rollback) etc.."),

Review Comment:
   ```suggestion
       TRANSACTION_OPERATION_FAILED("JDBC-07", "transaction operation failed, 
such as (commit, rollback) etc.."),
   ```



##########
seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/exception/JdbcConnectorErrorCode.java:
##########
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.seatunnel.connectors.seatunnel.jdbc.exception;
+
+import org.apache.seatunnel.common.exception.SeaTunnelErrorCode;
+
+public enum JdbcConnectorErrorCode implements SeaTunnelErrorCode {
+
+    CREATE_DRIVER_FAILED("JDBC-01", "Fail to create driver of class"),
+    NO_SUITABLE_DRIVER("JDBC-02", "No suitable driver found"),
+    SQL_OPERATION_FAILED("JDBC-03", "Sql operation failed, such as 
(execute,addBatch,close) etc..."),
+    XA_EXCEPTION("JDBC-04", "Xa operation failed, such as (commit, rollback) 
etc.."),
+    CONNECT_DATABASE_FAILED("JDBC-05", "Connector database failed"),
+    NULL_POINTER("JDBC-06", "Null pointer failed"),
+    EXCEPTION("JDBC-07", "transaction operation failed, such as (commit, 
rollback) etc.."),
+    NO_SUITABLE_DIALECT_FACTORY("JDBC-08", "No suitable dialect factory 
found");
+
+
+    private final String code;
+
+    private final String description;
+
+    JdbcConnectorErrorCode(String code, String description) {
+        this.code = code;
+        this.description = description;
+    }
+
+    @Override
+    public String getCode() {
+        return null;
+    }
+
+    @Override
+    public String getDescription() {
+        return null;

Review Comment:
   return description



##########
seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/exception/JdbcConnectorErrorCode.java:
##########
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.seatunnel.connectors.seatunnel.jdbc.exception;
+
+import org.apache.seatunnel.common.exception.SeaTunnelErrorCode;
+
+public enum JdbcConnectorErrorCode implements SeaTunnelErrorCode {
+
+    CREATE_DRIVER_FAILED("JDBC-01", "Fail to create driver of class"),
+    NO_SUITABLE_DRIVER("JDBC-02", "No suitable driver found"),
+    SQL_OPERATION_FAILED("JDBC-03", "Sql operation failed, such as 
(execute,addBatch,close) etc..."),
+    XA_EXCEPTION("JDBC-04", "Xa operation failed, such as (commit, rollback) 
etc.."),
+    CONNECT_DATABASE_FAILED("JDBC-05", "Connector database failed"),
+    NULL_POINTER("JDBC-06", "Null pointer failed"),
+    EXCEPTION("JDBC-07", "transaction operation failed, such as (commit, 
rollback) etc.."),
+    NO_SUITABLE_DIALECT_FACTORY("JDBC-08", "No suitable dialect factory 
found");
+
+
+    private final String code;
+
+    private final String description;
+
+    JdbcConnectorErrorCode(String code, String description) {
+        this.code = code;
+        this.description = description;
+    }
+
+    @Override
+    public String getCode() {
+        return null;

Review Comment:
   return code



##########
seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/exception/JdbcConnectorErrorCode.java:
##########
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.seatunnel.connectors.seatunnel.jdbc.exception;
+
+import org.apache.seatunnel.common.exception.SeaTunnelErrorCode;
+
+public enum JdbcConnectorErrorCode implements SeaTunnelErrorCode {
+
+    CREATE_DRIVER_FAILED("JDBC-01", "Fail to create driver of class"),
+    NO_SUITABLE_DRIVER("JDBC-02", "No suitable driver found"),
+    SQL_OPERATION_FAILED("JDBC-03", "Sql operation failed, such as 
(execute,addBatch,close) etc..."),
+    XA_EXCEPTION("JDBC-04", "Xa operation failed, such as (commit, rollback) 
etc.."),
+    CONNECT_DATABASE_FAILED("JDBC-05", "Connector database failed"),
+    NULL_POINTER("JDBC-06", "Null pointer failed"),

Review Comment:
   This error code is not clearly for users. Please change it.



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