Return-Path: X-Original-To: apmail-cloudstack-commits-archive@www.apache.org Delivered-To: apmail-cloudstack-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id DC75C1098C for ; Wed, 22 Jan 2014 19:28:49 +0000 (UTC) Received: (qmail 67188 invoked by uid 500); 22 Jan 2014 19:27:58 -0000 Delivered-To: apmail-cloudstack-commits-archive@cloudstack.apache.org Received: (qmail 66352 invoked by uid 500); 22 Jan 2014 19:27:40 -0000 Mailing-List: contact commits-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list commits@cloudstack.apache.org Received: (qmail 65740 invoked by uid 99); 22 Jan 2014 19:27:28 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Jan 2014 19:27:28 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id D95648A05C2; Wed, 22 Jan 2014 19:27:26 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: mchen@apache.org To: commits@cloudstack.apache.org Date: Wed, 22 Jan 2014 19:27:48 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [23/53] [abbrv] git commit: updated refs/heads/rbac to 33cd1ab CLOUDSTACK-5913:API rate limiting throws a different error than expected when Throttle limit hit in the API. Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/3689f72f Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/3689f72f Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/3689f72f Branch: refs/heads/rbac Commit: 3689f72f273c772a964ce5c8eb6a294151bb25ab Parents: 90e945f Author: Min Chen Authored: Mon Jan 20 15:49:19 2014 -0800 Committer: Min Chen Committed: Mon Jan 20 15:49:19 2014 -0800 ---------------------------------------------------------------------- server/src/com/cloud/api/ApiServer.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3689f72f/server/src/com/cloud/api/ApiServer.java ---------------------------------------------------------------------- diff --git a/server/src/com/cloud/api/ApiServer.java b/server/src/com/cloud/api/ApiServer.java index 3fb3495..71a1b8d 100755 --- a/server/src/com/cloud/api/ApiServer.java +++ b/server/src/com/cloud/api/ApiServer.java @@ -722,10 +722,13 @@ public class ApiServer extends ManagerBase implements HttpRequestHandler, ApiSer try { checkCommandAvailable(user, commandName); + } catch (RequestLimitException ex) { + s_logger.debug(ex.getMessage()); + throw new ServerApiException(ApiErrorCode.API_LIMIT_EXCEED, ex.getMessage()); } catch (PermissionDeniedException ex) { s_logger.debug("The given command:" + commandName + " does not exist or it is not available for user"); - throw new ServerApiException(ApiErrorCode.UNSUPPORTED_ACTION_ERROR, "The given command:" + commandName + - " does not exist or it is not available for user with id:" + userId); + throw new ServerApiException(ApiErrorCode.UNSUPPORTED_ACTION_ERROR, "The given command:" + commandName + " does not exist or it is not available for user with id:" + + userId); } // verify secret key exists