tristaZero commented on a change in pull request #9583:
URL: https://github.com/apache/shardingsphere/pull/9583#discussion_r587994666



##########
File path: 
shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/config/datasource/DataSourceConfiguration.java
##########
@@ -111,9 +112,13 @@ public DataSource createDataSource() {
             if (SKIPPED_PROPERTY_NAMES.contains(entry.getKey())) {
                 continue;
             }
-            Optional<Method> setterMethod = findSetterMethod(methods, 
entry.getKey());
-            if (setterMethod.isPresent()) {
-                setterMethod.get().invoke(result, entry.getValue());
+            try {
+                Optional<Method> setterMethod = findSetterMethod(methods, 
entry.getKey());
+                if (setterMethod.isPresent()) {
+                    setterMethod.get().invoke(result, entry.getValue());
+                }
+            } catch (final IllegalArgumentException ex) {
+                throw new ShardingSphereConfigurationException("Incorrect 
configuration item: the property %s of the dataSource. the reason is %s", 
entry.getKey(), ex.getMessage());

Review comment:
       Looks better. But at least it should be 
   > The reason is %s
   
   Or maybe we can consider
   > Incorrect configuration item: the property %s of the dataSource, because 
%s.




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to