You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by GitBox <gi...@apache.org> on 2019/06/20 04:08:58 UTC

[GitHub] [servicecomb-java-chassis] liubao68 commented on a change in pull request #1234: [SCB-1297]Environment parsing failed to fix

liubao68 commented on a change in pull request #1234: [SCB-1297]Environment parsing failed to fix
URL: https://github.com/apache/servicecomb-java-chassis/pull/1234#discussion_r295630180
 
 

 ##########
 File path: foundations/foundation-config/src/main/java/org/apache/servicecomb/config/ConfigurationSpringInitializer.java
 ##########
 @@ -197,11 +197,23 @@ private void getProperties(ConfigurableEnvironment environment, PropertySource<?
     if (propertySource instanceof EnumerablePropertySource) {
       EnumerablePropertySource<?> enumerablePropertySource = (EnumerablePropertySource<?>) propertySource;
       for (String propertyName : enumerablePropertySource.getPropertyNames()) {
-        configFromSpringBoot.put(propertyName, environment.getProperty(propertyName, Object.class));
+        try {
+          configFromSpringBoot.put(propertyName, environment.getProperty(propertyName, Object.class));
+        } catch (Exception e) {
+          if (!getIfIgnoreEnvironment()) {
+            throw new RuntimeException("set up spring property source failed.", e);
 
 Review comment:
   I think throw e is better

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services