spring-projects/spring-data-commons — pull request #48 by kazuki43zoo (2013-10-08 18:14:05+00:00)
Title: Added a exception handling for when was specified the invalid value in the pagination parameter.

[example of invalid value]
* page=-1 (negative numeric)
* size=a (not numeric)
* sort= (not specified)
* sort=,DESC (not specified property of sort target)
* etc ...

Current implementation of the PageableHandlerMethodArgumentResolver is occurred IllegalArgumentException, and http response status is returned 500(Innternal Server Error) on the default setting of SpringMVC.
I think a best that http response status is returned 400(Bad Request).

Easy a way for resolve this problem is that catch a IllegalArgumentException in PageableHandlerMethodArgumentResolver, and throw a ServletRequestBindingException.
ServletRequestBindingException is handled by the DefaultHandlerExceptionResolver, and http response status is returned 400(Bad Request).

What Do you think?
If you have a same thinking, Please pushed to a master branch.