Include new error codes in Exceptions

This commit is contained in:
Michael Lawley 2023-01-15 13:29:51 +10:00
parent e8c2320105
commit 8086e3eedd
1 changed files with 3 additions and 3 deletions

View File

@ -266,11 +266,11 @@ public class OperationParameter implements IParameter {
return null;
}
if (myMax >= 0 && matchingParamValues.size() > myMax) {
throw new InvalidRequestException("Too many " + myName + " parameters. Got " + matchingParamValues.size() + " but only " + myMax + " allowed.");
if (myMax != OperationParam.MAX_UNLIMITED && matchingParamValues.size() > myMax) {
throw new InvalidRequestException(Msg.code(2230) + "Too many " + myName + " parameters. Got " + matchingParamValues.size() + " but only " + myMax + " allowed.");
}
if (matchingParamValues.size() < myMin) {
throw new InvalidRequestException("Missing " + myName + " parameters. Got " + matchingParamValues.size() + " but need at least " + myMax);
throw new InvalidRequestException(Msg.code(2231) + "Missing " + myName + " parameters. Got " + matchingParamValues.size() + " but need at least " + myMax);
}
if (myInnerCollectionType == null) {