This is an automated email from the ASF dual-hosted git repository.

panjuan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git


The following commit(s) were added to refs/heads/master by this push:
     new 3d10f1fcb6f Fix sonar issue for SQLExecutorExceptionHandler (#25628)
3d10f1fcb6f is described below

commit 3d10f1fcb6f8d7b252c98b8a321dc5f773ba8ef0
Author: Liang Zhang <[email protected]>
AuthorDate: Fri May 12 21:27:14 2023 +0800

    Fix sonar issue for SQLExecutorExceptionHandler (#25628)
---
 .../infra/executor/sql/execute/engine/SQLExecutorExceptionHandler.java  | 2 ++
 1 file changed, 2 insertions(+)

diff --git 
a/infra/executor/src/main/java/org/apache/shardingsphere/infra/executor/sql/execute/engine/SQLExecutorExceptionHandler.java
 
b/infra/executor/src/main/java/org/apache/shardingsphere/infra/executor/sql/execute/engine/SQLExecutorExceptionHandler.java
index 268350d988b..1c86a1ed9fb 100644
--- 
a/infra/executor/src/main/java/org/apache/shardingsphere/infra/executor/sql/execute/engine/SQLExecutorExceptionHandler.java
+++ 
b/infra/executor/src/main/java/org/apache/shardingsphere/infra/executor/sql/execute/engine/SQLExecutorExceptionHandler.java
@@ -59,11 +59,13 @@ public final class SQLExecutorExceptionHandler {
      */
     public static void handleException(final Exception exception) throws 
SQLException {
         if (isExceptionThrown()) {
+            IS_EXCEPTION_THROWN.remove();
             if (exception instanceof SQLException) {
                 throw (SQLException) exception;
             }
             throw new UnknownSQLException(exception).toSQLException();
         }
+        IS_EXCEPTION_THROWN.remove();
         log.error("exception occur: ", exception);
     }
 }

Reply via email to