From 6929bd947348c3912c19a260428c063bb0aea0ea Mon Sep 17 00:00:00 2001 From: Rohit Yadav Date: Thu, 3 Jan 2013 22:18:27 -0800 Subject: [PATCH] server: Don't silently ignore uuid param translation for required param in case they fail Signed-off-by: Rohit Yadav --- server/src/com/cloud/api/ApiDispatcher.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/server/src/com/cloud/api/ApiDispatcher.java b/server/src/com/cloud/api/ApiDispatcher.java index 0f7f0929a55..9ae048ece3a 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; }