rafaelweingartner commented on issue #2298: CLOUDSTACK-9620: Enhancements for managed storage URL: https://github.com/apache/cloudstack/pull/2298#issuecomment-355677448 That happens :) Yes, that is what I meant. Actually, you can even go one step further to take this code out of the conditional: ``` if (srcSnapshotInfo.getDataStore().getId() == destVolumeInfo.getDataStore().getId()) { handleCreateVolumeFromSnapshotBothOnStorageSystem(srcSnapshotInfo, destVolumeInfo, callback); } else { String errMsg = "To perform this operation, the source and destination primary storages must be the same."; handleError(errMsg, callback); } ``` you can use `if(!canHandleSrc)`, then throw the appropriated exception. Then, you have your nice chunk of happy day (everything working and handling things as they should) code out of IFs
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
