Github user jburwell commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/1615#discussion_r73765448
  
    --- Diff: server/src/com/cloud/configuration/ConfigurationManagerImpl.java 
---
    @@ -520,6 +528,16 @@ public String updateConfiguration(final long userId, 
final String name, final St
                         _accountDetailsDao.update(accountDetailVO.getId(), 
accountDetailVO);
                     }
                     break;
    +
    +            case ImageStore:
    +                final ImageStoreVO imgStore = 
_imageStoreDao.findById(resourceId);
    +                if (imgStore == null) {
    +                    throw new InvalidParameterValueException("unable to 
find image store by id " + resourceId);
    --- End diff --
    
    ``InvalidParameterValueException`` is used to indicate that an invalid 
parameter was passed by a caller to a method.  Since ``imgStore`` was not 
passed into this method, it does not seem appropriate to use this exception 
type.  ``IllegalStateException`` seems more appropriate.  Also, consider using 
``Preconditions.checkState`` to replace the ``if`` block with a single line of 
code for greater concession.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to