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; }