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

    https://github.com/apache/cloudstack/pull/1365#discussion_r58786157
  
    --- Diff: 
vmware-base/src/com/cloud/hypervisor/vmware/mo/VirtualMachineMO.java ---
    @@ -2137,7 +2141,8 @@ public int getScsiDiskControllerKey(String 
diskController) throws Exception {
             }
     
             assert (false);
    -        throw new Exception(diskController + " Controller Not Found");
    +        throw new Exception("Scsi disk controller of type " + 
diskController + " not found among configured devices:" + deviceList +
    +                ". Unable to find and return scsi disk controller key.");
    --- End diff --
    
    Throwing ``Exception`` is an anti-pattern.  Use a specific checked or 
unchecked exception type to better express the nature of the problem (e.g. 
``IllegalStateException``).  Also, since an exception is being thrown, 
``assert(false)`` is not necessary and can be removed.


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