You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by bh...@apache.org on 2013/01/04 07:34:14 UTC
[5/5] git commit: server: Don't silently ignore uuid param
translation for required param in case they fail
Updated Branches:
refs/heads/api_refactoring 32f035c9f -> 6929bd947
server: Don't silently ignore uuid param translation for required param in case they fail
Signed-off-by: Rohit Yadav <bh...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/6929bd94
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/6929bd94
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/6929bd94
Branch: refs/heads/api_refactoring
Commit: 6929bd947348c3912c19a260428c063bb0aea0ea
Parents: 6fa8c70
Author: Rohit Yadav <bh...@apache.org>
Authored: Thu Jan 3 22:18:27 2013 -0800
Committer: Rohit Yadav <bh...@apache.org>
Committed: Thu Jan 3 22:32:47 2013 -0800
----------------------------------------------------------------------
server/src/com/cloud/api/ApiDispatcher.java | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6929bd94/server/src/com/cloud/api/ApiDispatcher.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/ApiDispatcher.java b/server/src/com/cloud/api/ApiDispatcher.java
index 0f7f092..9ae048e 100755
--- a/server/src/com/cloud/api/ApiDispatcher.java
+++ b/server/src/com/cloud/api/ApiDispatcher.java
@@ -582,8 +582,14 @@ public class ApiDispatcher {
if (internalId != null)
break;
}
- if (internalId == null && s_logger.isDebugEnabled()) {
- s_logger.debug("Object entity with uuid=" + uuid + " does not exist in the database.");
+ if (internalId == null) {
+ if (s_logger.isDebugEnabled()) {
+ s_logger.debug("Object entity with uuid=" + uuid + " does not exist in the database.");
+ }
+ if (annotation.required()) {
+ throw new InvalidParameterValueException("Invalid parameter with uuid=" + uuid
+ + ". Entity not found, or an annotation bug.");
+ }
}
return internalId;
}