Merged 5.2.N (5.2.1) to HEAD (5.2)

129730 mmuller: Add a specific error message for invalid maxItem and skipCount. REPO-1061.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@130221 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alan Davis
2016-09-06 14:41:53 +00:00
parent bd54639d22
commit fc99db194d

View File

@@ -800,9 +800,18 @@ public class ResourceWebScriptHelper
{
if (logger.isDebugEnabled())
{
logger.debug("Invalid paging params skip: " + skip + ",maxItems:" + maxItems);
logger.debug("Invalid paging parameters skipCount: " + skip + ", maxItems:" + maxItems);
}
throw new InvalidArgumentException();
String errorMsg = "Invalid paging parameters skipCount: " + skip + ", maxItems:" + maxItems;
if (skip == null)
{
errorMsg = "Invalid paging parameter maxItems:" + maxItems;
}
if (maxItems == null)
{
errorMsg = "Invalid paging parameter skipCount:" + skip;
}
throw new InvalidArgumentException(errorMsg);
}
return Paging.valueOf(skipped, max);