ApiDispatcher: In case of incorrect long int value or uuid, throw error Signed-off-by: Rohit Yadav <[email protected]>
Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/b120e192 Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/b120e192 Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/b120e192 Branch: refs/heads/cloud-agent-with-openvswitch Commit: b120e19280b994df940fd4fe6711a761eb174cad Parents: cd37e22 Author: Rohit Yadav <[email protected]> Authored: Thu Jan 17 17:59:25 2013 -0800 Committer: Rohit Yadav <[email protected]> Committed: Thu Jan 17 17:59:53 2013 -0800 ---------------------------------------------------------------------- server/src/com/cloud/api/ApiDispatcher.java | 7 ++----- 1 files changed, 2 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/b120e192/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 04b46e5..129ef7d 100755 --- a/server/src/com/cloud/api/ApiDispatcher.java +++ b/server/src/com/cloud/api/ApiDispatcher.java @@ -349,7 +349,6 @@ public class ApiDispatcher { try { internalId = Long.parseLong(uuid); } catch(NumberFormatException e) { - // In case regex failed, and it's still uuid string internalId = null; } if (internalId != null) @@ -381,10 +380,8 @@ public class ApiDispatcher { 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."); - } + throw new InvalidParameterValueException("Invalid parameter value=" + uuid + + " due to incorrect long value, entity not found, or an annotation bug."); } return internalId; }
