Skip to content

Commit 3914e50

Browse files
author
Glover, Rene (rg9975)
committed
updates for StorageAccessException
1 parent a55c3e5 commit 3914e50

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

api/src/main/java/com/cloud/exception/StorageAccessException.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
public class StorageAccessException extends RuntimeException {
2727
private static final long serialVersionUID = SerialVersionUID.StorageAccessException;
2828

29-
public StorageAccessException(String message) {
30-
super(message);
29+
public StorageAccessException(String message, Exception causer) {
30+
super(message, causer);
3131
}
3232
}

engine/orchestration/src/main/java/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1827,7 +1827,7 @@ private Pair<VolumeVO, DataStore> recreateVolume(VolumeVO vol, VirtualMachinePro
18271827
try {
18281828
volService.grantAccess(volFactory.getVolume(newVol.getId()), host, destPool);
18291829
} catch (Exception e) {
1830-
throw new StorageAccessException(String.format("Unable to grant access to the volume [%s] on host [%s].", newVolToString, host));
1830+
throw new StorageAccessException(String.format("Unable to grant access to the volume [%s] on host [%s].", newVolToString, host), e);
18311831
}
18321832
}
18331833

@@ -1867,7 +1867,7 @@ protected void grantVolumeAccessToHostIfNeeded(PrimaryDataStore volumeStore, lon
18671867
try {
18681868
volService.grantAccess(volFactory.getVolume(volumeId), host, volumeStore);
18691869
} catch (Exception e) {
1870-
throw new StorageAccessException(String.format("Unable to grant access to volume [%s] on host [%s].", volToString, host));
1870+
throw new StorageAccessException(String.format("Unable to grant access to volume [%s] on host [%s].", volToString, host), e);
18711871
}
18721872
}
18731873

@@ -1915,7 +1915,7 @@ public void prepare(VirtualMachineProfile vm, DeployDestination dest) throws Sto
19151915
try {
19161916
volService.grantAccess(volFactory.getVolume(vol.getId()), host, store);
19171917
} catch (Exception e) {
1918-
throw new StorageAccessException(String.format("Unable to grant access to volume [%s] on host [%s].", volToString, host));
1918+
throw new StorageAccessException(String.format("Unable to grant access to volume [%s] on host [%s].", volToString, host), e);
19191919
}
19201920
} else {
19211921
grantVolumeAccessToHostIfNeeded(store, vol.getId(), host, volToString);

engine/storage/volume/src/main/java/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1161,7 +1161,7 @@ private void createManagedVolumeCopyManagedTemplateAsync(VolumeInfo volumeInfo,
11611161
try {
11621162
grantAccess(srcTemplateOnPrimary, destHost, destPrimaryDataStore);
11631163
} catch (Exception e) {
1164-
throw new StorageAccessException("Unable to grant access to src template: " + srcTemplateOnPrimary.getId() + " on host: " + destHost.getId());
1164+
throw new StorageAccessException("Unable to grant access to src template: " + srcTemplateOnPrimary.getId() + " on host: " + destHost.getId(), e);
11651165
}
11661166

11671167
_volumeDetailsDao.addDetail(volumeInfo.getId(), volumeDetailKey, String.valueOf(templatePoolRef.getId()), false);
@@ -1406,7 +1406,7 @@ public TemplateInfo createManagedStorageTemplate(long srcTemplateId, long destDa
14061406
try {
14071407
grantAccess(templateOnPrimary, destHost, destPrimaryDataStore);
14081408
} catch (Exception e) {
1409-
throw new StorageAccessException("Unable to grant access to template: " + templateOnPrimary.getId() + " on host: " + destHost.getId());
1409+
throw new StorageAccessException("Unable to grant access to template: " + templateOnPrimary.getId() + " on host: " + destHost.getId(), e);
14101410
}
14111411

14121412
templateOnPrimary.processEvent(Event.CopyingRequested);

0 commit comments

Comments
 (0)