You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by zh...@apache.org on 2022/11/16 15:32:42 UTC

[shardingsphere] branch master updated: Change Exception to SQLException and RuntimeException when validate storage unit. (#22217)

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

zhangliang 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 a78b59bb157 Change Exception to SQLException and RuntimeException when validate storage unit. (#22217)
a78b59bb157 is described below

commit a78b59bb15799912ab58c4e406fac0a303fdeea1
Author: Raigor <ra...@gmail.com>
AuthorDate: Wed Nov 16 23:32:29 2022 +0800

    Change Exception to SQLException and RuntimeException when validate storage unit. (#22217)
---
 .../infra/datasource/props/DataSourcePropertiesValidator.java          | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/infra/common/src/main/java/org/apache/shardingsphere/infra/datasource/props/DataSourcePropertiesValidator.java b/infra/common/src/main/java/org/apache/shardingsphere/infra/datasource/props/DataSourcePropertiesValidator.java
index 4604659acd2..3fd07a9a905 100644
--- a/infra/common/src/main/java/org/apache/shardingsphere/infra/datasource/props/DataSourcePropertiesValidator.java
+++ b/infra/common/src/main/java/org/apache/shardingsphere/infra/datasource/props/DataSourcePropertiesValidator.java
@@ -59,8 +59,7 @@ public final class DataSourcePropertiesValidator {
             dataSource = DataSourcePoolCreator.create(dataSourceProps);
             checkFailFast(dataSource);
             // CHECKSTYLE:OFF
-            // TODO check why catch exception here, can it simplify to catch SQLException and ShardingSphereInternalException?
-        } catch (final Exception ex) {
+        } catch (final SQLException | RuntimeException ex) {
             // CHECKSTYLE:ON
             throw new InvalidDataSourcePropertiesException(dataSourceName, ex.getMessage());
         } finally {