Skip to content

Commit 3689f72

Browse files
committed
CLOUDSTACK-5913:API rate limiting throws a different error than expected
when Throttle limit hit in the API.
1 parent 90e945f commit 3689f72

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

‎server/src/com/cloud/api/ApiServer.java‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -722,10 +722,13 @@ public boolean verifyRequest(Map<String, Object[]> requestParameters, Long userI
722722

723723
try {
724724
checkCommandAvailable(user, commandName);
725+
} catch (RequestLimitException ex) {
726+
s_logger.debug(ex.getMessage());
727+
throw new ServerApiException(ApiErrorCode.API_LIMIT_EXCEED, ex.getMessage());
725728
} catch (PermissionDeniedException ex) {
726729
s_logger.debug("The given command:" + commandName + " does not exist or it is not available for user");
727-
throw new ServerApiException(ApiErrorCode.UNSUPPORTED_ACTION_ERROR, "The given command:" + commandName +
728-
" does not exist or it is not available for user with id:" + userId);
730+
throw new ServerApiException(ApiErrorCode.UNSUPPORTED_ACTION_ERROR, "The given command:" + commandName + " does not exist or it is not available for user with id:"
731+
+ userId);
729732
}
730733

731734
// verify secret key exists

0 commit comments

Comments
 (0)