Skip to content

Commit daa3813

Browse files
committed
Change in exception message displayed when creating template from volume
1 parent 9ae696d commit daa3813

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

server/src/main/java/com/cloud/template/TemplateManagerImpl.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,8 @@ public DataStore getImageStore(String storeUuid, Long zoneId, VolumeVO volume) {
476476
}
477477

478478
if (imageStore == null) {
479-
throw new CloudRuntimeException(String.format("Cannot find an image store for zone [%s].", zoneId));
479+
logger.error("Cannot find an image store for zone [{}].", zoneId);
480+
throw new CloudRuntimeException("Failed to create template. Please contact the cloud administrator.");
480481
}
481482

482483
return imageStore;
@@ -1702,7 +1703,8 @@ public VirtualMachineTemplate createPrivateTemplate(CreateTemplateCmd command) t
17021703
}
17031704
DataStore store = _dataStoreMgr.getImageStoreWithFreeCapacity(zoneId);
17041705
if (store == null) {
1705-
throw new CloudRuntimeException("cannot find an image store for zone " + zoneId);
1706+
logger.error("Cannot find an image store for zone [{}].", zoneId);
1707+
throw new CloudRuntimeException("Failed to create template. Please contact the cloud administrator.");
17061708
}
17071709
AsyncCallFuture<TemplateApiResult> future = null;
17081710

0 commit comments

Comments
 (0)