Why "InvalidRequest" On 2nd Hit Of Page 2 Of Pagination?
I do pagination and a link that works to page 2 looks like this /q?query=regionID%3D4700188&cursor=False:CqoECuYBCtgB_wDAQM8HgAD_AP8A_wD__wDAQCQA_wD_AP8A_wD_AP__AMBAHAD_AP8A_wD
Solution 1:
I can only guess that it's RegionSearch that's failing. You'll need to handle exceptions on your queries. See https://developers.google.com/appengine/docs/python/datastore/exceptions
The exception will tell you what the error is. Hard to guess.
EDIT:
try:
# do query
except search.PutError as e:
logging.exception('caught PutError %s', e)
except search.InternalError as e:
logging.exception('caught InternalError %s', e)
except search.DeleteError as e:
logging.exception('caught DeleteError %s', e)
except search.TransientError as e:
logging.exception('caught TransientError %s', e)
except search.InvalidRequest as e:
logging.exception('caught InvalidError %s', e)
except search.Error as e:
logging.exception('caught unknown error %s', e)
Solution 2:
Try setting the SortExpression's default_value to None, that worked for me.
I was getting the same issue in my Test/QA instance however in my PROD instance worked fine, setting the default_value to None solved the problem in the Test/QA instance for good.
Post a Comment for "Why "InvalidRequest" On 2nd Hit Of Page 2 Of Pagination?"