Skip to content

Commit 6929bd9

Browse files
committed
server: Don't silently ignore uuid param translation for required param in case they fail
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
1 parent 6fa8c70 commit 6929bd9

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

‎server/src/com/cloud/api/ApiDispatcher.java‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -582,8 +582,14 @@ private static Long translateUuidToInternalId(String uuid, Parameter annotation)
582582
if (internalId != null)
583583
break;
584584
}
585-
if (internalId == null && s_logger.isDebugEnabled()) {
586-
s_logger.debug("Object entity with uuid=" + uuid + " does not exist in the database.");
585+
if (internalId == null) {
586+
if (s_logger.isDebugEnabled()) {
587+
s_logger.debug("Object entity with uuid=" + uuid + " does not exist in the database.");
588+
}
589+
if (annotation.required()) {
590+
throw new InvalidParameterValueException("Invalid parameter with uuid=" + uuid
591+
+ ". Entity not found, or an annotation bug.");
592+
}
587593
}
588594
return internalId;
589595
}

0 commit comments

Comments
 (0)