Carl-Zhou-CN commented on code in PR #3598:
URL: 
https://github.com/apache/incubator-seatunnel/pull/3598#discussion_r1035547858


##########
seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/sink/JdbcExactlyOnceSinkWriter.java:
##########
@@ -171,7 +172,7 @@ private void beginTx() throws IOException {
         try {
             xaFacade.start(currentXid);
         } catch (Exception e) {
-            ExceptionUtils.rethrowIOException(e);
+            throw new 
JdbcConnectorException(JdbcConnectorErrorCode.XA_EXCEPTION, e);

Review Comment:
   ok



##########
seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/xa/XaFacadeImplAutoLoad.java:
##########
@@ -89,18 +92,16 @@ public void open() throws SQLException {
         XADataSource ds;
         try {
             ds = (XADataSource) 
DataSourceUtils.buildCommonDataSource(jdbcConnectionOptions);
-        }
-        catch (Exception e) {
-            throw new SQLException(e);
+        } catch (Exception e) {
+            throw new 
JdbcConnectorException(JdbcConnectorErrorCode.CONNECT_DATABASE_FAILED, e);
         }
         xaConnection = ds.getXAConnection();
         xaResource = xaConnection.getXAResource();
         if (jdbcConnectionOptions.getTransactionTimeoutSec().isPresent()) {
             try {
                 
xaResource.setTransactionTimeout(jdbcConnectionOptions.getTransactionTimeoutSec().get());
-            }
-            catch (XAException e) {
-                throw new SQLException(e);
+            } catch (XAException e) {
+                throw new 
JdbcConnectorException(JdbcConnectorErrorCode.XA_EXCEPTION, e);

Review Comment:
   ok



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