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

totalo 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 fe592e0bb2d Refactor ShardingSphereSQLException and 
SQLDialectException (#20741)
fe592e0bb2d is described below

commit fe592e0bb2d032acc075a76bdcf8e105bc5719f3
Author: Liang Zhang <[email protected]>
AuthorDate: Fri Sep 2 20:36:28 2022 +0800

    Refactor ShardingSphereSQLException and SQLDialectException (#20741)
---
 .../shardingsphere/dialect/exception/SQLDialectException.java  | 10 +---------
 .../infra/util/exception/sql/ShardingSphereSQLException.java   |  3 +--
 .../proxy/frontend/exception/ExpectedExceptions.java           |  4 +++-
 3 files changed, 5 insertions(+), 12 deletions(-)

diff --git 
a/shardingsphere-dialect-exception/shardingsphere-dialect-exception-core/src/main/java/org/apache/shardingsphere/dialect/exception/SQLDialectException.java
 
b/shardingsphere-dialect-exception/shardingsphere-dialect-exception-core/src/main/java/org/apache/shardingsphere/dialect/exception/SQLDialectException.java
index b022442cf5d..8b86a24a5b7 100644
--- 
a/shardingsphere-dialect-exception/shardingsphere-dialect-exception-core/src/main/java/org/apache/shardingsphere/dialect/exception/SQLDialectException.java
+++ 
b/shardingsphere-dialect-exception/shardingsphere-dialect-exception-core/src/main/java/org/apache/shardingsphere/dialect/exception/SQLDialectException.java
@@ -17,18 +17,10 @@
 
 package org.apache.shardingsphere.dialect.exception;
 
-import lombok.NoArgsConstructor;
-import 
org.apache.shardingsphere.infra.util.exception.ShardingSphereInsideException;
-
 /**
  * SQL dialect exception.
  */
-@NoArgsConstructor
-public abstract class SQLDialectException extends 
ShardingSphereInsideException {
+public abstract class SQLDialectException extends RuntimeException {
     
     private static final long serialVersionUID = -5090068160364259336L;
-    
-    public SQLDialectException(final String errorMessage, final Object... 
args) {
-        super(errorMessage, args);
-    }
 }
diff --git 
a/shardingsphere-infra/shardingsphere-infra-util/src/main/java/org/apache/shardingsphere/infra/util/exception/sql/ShardingSphereSQLException.java
 
b/shardingsphere-infra/shardingsphere-infra-util/src/main/java/org/apache/shardingsphere/infra/util/exception/sql/ShardingSphereSQLException.java
index cf4c5660e7a..6d2c454570e 100644
--- 
a/shardingsphere-infra/shardingsphere-infra-util/src/main/java/org/apache/shardingsphere/infra/util/exception/sql/ShardingSphereSQLException.java
+++ 
b/shardingsphere-infra/shardingsphere-infra-util/src/main/java/org/apache/shardingsphere/infra/util/exception/sql/ShardingSphereSQLException.java
@@ -18,14 +18,13 @@
 package org.apache.shardingsphere.infra.util.exception.sql;
 
 import org.apache.shardingsphere.infra.util.exception.sql.sqlstate.SQLState;
-import 
org.apache.shardingsphere.infra.util.exception.ShardingSphereInsideException;
 
 import java.sql.SQLException;
 
 /**
  * ShardingSphere SQL exception.
  */
-public abstract class ShardingSphereSQLException extends 
ShardingSphereInsideException {
+public abstract class ShardingSphereSQLException extends RuntimeException {
     
     private static final long serialVersionUID = -8238061892944243621L;
     
diff --git 
a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-core/src/main/java/org/apache/shardingsphere/proxy/frontend/exception/ExpectedExceptions.java
 
b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-core/src/main/java/org/apache/shardingsphere/proxy/frontend/exception/ExpectedExceptions.java
index 5bebcc8e4ad..44ef0d7a231 100644
--- 
a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-core/src/main/java/org/apache/shardingsphere/proxy/frontend/exception/ExpectedExceptions.java
+++ 
b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-core/src/main/java/org/apache/shardingsphere/proxy/frontend/exception/ExpectedExceptions.java
@@ -19,8 +19,9 @@ package org.apache.shardingsphere.proxy.frontend.exception;
 
 import lombok.AccessLevel;
 import lombok.NoArgsConstructor;
-import 
org.apache.shardingsphere.infra.util.exception.ShardingSphereServerException;
+import org.apache.shardingsphere.dialect.exception.SQLDialectException;
 import 
org.apache.shardingsphere.infra.util.exception.ShardingSphereInsideException;
+import 
org.apache.shardingsphere.infra.util.exception.ShardingSphereServerException;
 import 
org.apache.shardingsphere.infra.util.exception.sql.ShardingSphereSQLException;
 
 import java.util.Collection;
@@ -38,6 +39,7 @@ public final class ExpectedExceptions {
         EXCEPTIONS.add(ShardingSphereServerException.class);
         EXCEPTIONS.add(ShardingSphereInsideException.class);
         EXCEPTIONS.add(ShardingSphereSQLException.class);
+        EXCEPTIONS.add(SQLDialectException.class);
     }
     
     /**

Reply via email to