Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
1.5.3
-
None
Description
In my application I need to get current page parameter from PageParameters
so I use this code
PageParameters parameters = ...
int currentPage = parameters.get("page").toInt(1);
It works good when "page" parameter contains an Integer value or is null, but when it contains a non numeric value it throws an exception StringValueConversionException.
I would expect a little bit different behaviour. Why not to return DEFAULT value when StringValueConversionException is thrown? I think it is more secure and saves many lines of code, because you do not need to check that StringValue is really a string containing only numeric characters.