You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2021/06/28 14:28:14 UTC

[GitHub] [cloudstack] sureshanaparti commented on a change in pull request #4721: preserve root cause in exception

sureshanaparti commented on a change in pull request #4721:
URL: https://github.com/apache/cloudstack/pull/4721#discussion_r659837549



##########
File path: engine/storage/datamotion/src/main/java/org/apache/cloudstack/storage/motion/StorageSystemDataMotionStrategy.java
##########
@@ -1932,8 +1932,9 @@ public void copyAsync(Map<VolumeInfo, DataStore> volumeDataStoreMap, VirtualMach
             errMsg = String.format("Copy volume(s) to storage(s) [%s] and VM to host [%s] failed in StorageSystemDataMotionStrategy.copyAsync. Error message: [%s].", volumesAndStorages, formatMigrationElementsAsJsonToDisplayOnLog("vm", vmTO.getId(), srcHost.getId(), destHost.getId()), ex.getMessage());
             LOGGER.error(errMsg, ex);
 
-            throw new CloudRuntimeException(errMsg);
-        } finally {
+            throw new CloudRuntimeException(errMsg, ex);

Review comment:
       @DaanHoogland The custom error message in the CloudRuntimeException thrown, has the exception message (of root cause), which is also logged along with the stack trace. So, the root cause message is already passed to the top layer. Correct?




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

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org