This is an ArgumentError raised in case a page was requested that is either zero or negative number. You should decide how do deal with such errors in the controller.
If you’re using Rails 2, then this error will automatically get handled like 404 Not Found. The hook is in “will_paginate.rb”:
ActionController::Base.rescue_responses['WillPaginate::InvalidPage'] = :not_found
If you don’t like this, use your preffered method of rescuing exceptions
in public from your controllers to handle this differently. The
rescue_from method is a nice addition to Rails 2.
This error is not raised when a page further than the last
page is requested. Use WillPaginate::Collection#out_of_bounds?
method to check for those cases and manually deal with them as you see fit.