mirror of https://github.com/apache/cloudstack.git
Improve error handling for a host-side error
This commit is contained in:
parent
1b5bb7d8c6
commit
8766c8ad43
|
|
@ -49,7 +49,7 @@ public class FakePrimaryDataStoreDriver implements PrimaryDataStoreDriver {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean grantAccess(DataObject dataObject, Host host, DataStore dataStore) { return false; }
|
||||
public boolean grantAccess(DataObject dataObject, Host host, DataStore dataStore) { return false; }
|
||||
|
||||
@Override
|
||||
public void revokeAccess(DataObject dataObject, Host host, DataStore dataStore) {}
|
||||
|
|
|
|||
|
|
@ -245,6 +245,19 @@ public class StorageSystemSnapshotStrategy extends SnapshotStrategyBase {
|
|||
}
|
||||
}
|
||||
|
||||
if (snapshotAndCopyAnswer == null || !snapshotAndCopyAnswer.getResult()) {
|
||||
final String errMsg;
|
||||
|
||||
if (snapshotAndCopyAnswer != null && snapshotAndCopyAnswer.getDetails() != null && !snapshotAndCopyAnswer.getDetails().isEmpty()) {
|
||||
errMsg = snapshotAndCopyAnswer.getDetails();
|
||||
}
|
||||
else {
|
||||
errMsg = "Unable to perform host-side operation";
|
||||
}
|
||||
|
||||
throw new CloudRuntimeException(errMsg);
|
||||
}
|
||||
|
||||
String path = snapshotAndCopyAnswer.getPath(); // for XenServer, this is the VDI's UUID
|
||||
|
||||
SnapshotDetailsVO snapshotDetail = new SnapshotDetailsVO(snapshotInfo.getId(),
|
||||
|
|
|
|||
Loading…
Reference in New Issue