server: Show network name in exception message (#4396)

* Show network name in exception message

* Update server/src/main/java/com/cloud/vm/UserVmManagerImpl.java

Co-authored-by: dahn <daan.hoogland@gmail.com>
This commit is contained in:
Rakesh 2021-02-19 09:34:39 +01:00 committed by GitHub
parent aab2447656
commit fd49efa9c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -3969,7 +3969,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir
// * verify that there are no duplicates
if (hostNames.contains(hostName)) {
throw new InvalidParameterValueException("The vm with hostName " + hostName + " already exists in the network domain: " + ntwkDomain.getKey() + "; network="
+ _networkModel.getNetwork(ntwkId));
+ (_networkModel.getNetwork(ntwkId) != null) ? _networkModel.getNetwork(ntwkId).getName()) : "<unknown>";
}
}
}