You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bug 13127: API error text refer to database ids instead of uuids
Description:
Modifying the API functions' exception handling to call
addProxyObject() wherever applicable, and removing some
wrong calls to addProxyObject() that were put in in an
earlier commit for this bug.
With this commit, we cover many API functions to use the
new exception handling code, but some pieces may still be
left out. These will be covered as work in progress, when
making changes to the CS API code.
Copy file name to clipboardExpand all lines: api/src/com/cloud/api/BaseCmd.java
+20-3Lines changed: 20 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -60,6 +60,7 @@
60
60
importcom.cloud.user.ResourceLimitService;
61
61
importcom.cloud.utils.Pair;
62
62
importcom.cloud.utils.component.ComponentLocator;
63
+
importcom.cloud.utils.AnnotationHelper;
63
64
importcom.cloud.vm.BareMetalVmService;
64
65
importcom.cloud.vm.UserVmService;
65
66
@@ -485,7 +486,7 @@ public Long finalyzeAccountId(String accountName, Long domainId, Long projectId,
485
486
if (!enabledOnly || account.getState() == Account.State.enabled) {
486
487
returnaccount.getId();
487
488
} else {
488
-
thrownewPermissionDeniedException("Can't add resources to the account id=" + account.getId() + " in state=" + account.getState() + " as it's no longer active");
489
+
thrownewPermissionDeniedException("Can't add resources to the account id=" + account.getId() + " in state=" + account.getState() + " as it's no longer active");
489
490
}
490
491
} else {
491
492
thrownewInvalidParameterValueException("Unable to find account by name " + accountName + " in domain id=" + domainId);
@@ -498,10 +499,26 @@ public Long finalyzeAccountId(String accountName, Long domainId, Long projectId,
498
499
if (!enabledOnly || project.getState() == Project.State.Active) {
499
500
returnproject.getProjectAccountId();
500
501
} else {
501
-
thrownewPermissionDeniedException("Can't add resources to the project id=" + projectId + " in state=" + project.getState() + " as it's no longer active");
502
+
PermissionDeniedExceptionex = newPermissionDeniedException("Can't add resources to the project with specified projectId in state=" + project.getState() + " as it's no longer active");
thrownewInvalidParameterValueException("Unable to find domain by specified id");
2341
2351
}
2342
2352
_accountMgr.checkAccess(caller, domain);
2343
2353
}
@@ -2488,8 +2498,14 @@ public Network createGuestNetwork(long networkOfferingId, String name, String di
2488
2498
if (ntwkOff.getState() != NetworkOffering.State.Enabled) {
2489
2499
// see NetworkOfferingVO
2490
2500
InvalidParameterValueExceptionex = newInvalidParameterValueException("Can't use specified network offering id as its stat is not " + NetworkOffering.State.Enabled);
0 commit comments