server: Don't silently ignore uuid param translation for required param in case they fail

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
This commit is contained in:
Rohit Yadav 2013-01-03 22:18:27 -08:00
parent 6fa8c708ee
commit 6929bd9473
1 changed files with 8 additions and 2 deletions

View File

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