You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The ArgumentError feedback should report the value of the original offending variable passed to the constructor.
Currently it reports the (possibly transformed by to_i) value of the instance variable. If you pass page: 'foo' then you should get an argument error saying expected :page in 1..23; got "foo" instead of expected :page in 1..23; got 0.
The text was updated successfully, but these errors were encountered:
Would it be possible to change the behaviour so it redirects to page=1? Users have to manually enter a wrong page value to get there, but I feel like a 500 is a bit harsh.
With old versions you can rescue ArgumentError and check the message for the variable and the value.
With the new version you have Pagy::VariableError with the accessors for the offending variable and its value.
HTH
The
ArgumentError
feedback should report the value of the original offending variable passed to the constructor.Currently it reports the (possibly transformed by
to_i
) value of the instance variable. If you passpage: 'foo'
then you should get an argument error sayingexpected :page in 1..23; got "foo"
instead ofexpected :page in 1..23; got 0
.The text was updated successfully, but these errors were encountered: