cloudstack-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anshul1886 <...@git.apache.org>
Subject [GitHub] cloudstack pull request: CLOUDSTACK-7930, CLOUDSTACK-7931: Do not ...
Date Tue, 18 Nov 2014 07:57:30 GMT
Github user anshul1886 commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/41#discussion_r20489860
  
    --- Diff: server/src/com/cloud/configuration/ConfigurationManagerImpl.java ---
    @@ -725,6 +725,21 @@ private String validateConfigurationValue(String name, String value,
String scop
                 type = c.getType();
             }
     
    +        String errMsg = null;
    +        try {
    +            if (type.equals(Integer.class)) {
    +                errMsg = "There was error in trying to parse value: " + value + ". Please
enter a valid integer value for parameter " + name;
    +                Integer.parseInt(value);
    +            } else if (type.equals(Float.class)) {
    +                errMsg = "There was error in trying to parse value: " + value + ". Please
enter a valid float value for parameter " + name;
    +                Float.parseFloat(value);
    +            }
    +        } catch (Exception e) {
    --- End diff --
    
    What value will be added by catching specific exceptions?
    In the end user only wants to know whether the value is valid or not. he/she is not concerned
with what type of exception he is getting.



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message