ApiDispatcher: In case of incorrect long int value or uuid, throw error

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
This commit is contained in:
Rohit Yadav 2013-01-17 17:59:25 -08:00
parent cd37e22f9b
commit b120e19280
1 changed files with 2 additions and 5 deletions

View File

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