Page MenuHomePhabricator

Improve error for invalid page name
Open, MediumPublic


If you type an invalid Wikipedia page title into the search box you are presented with an "Oops! Something went wrong" page with the full traceback displayed. We should probably not even take users off the edit page, catching the error and keeping them there with a more helpful error notice.

Event Timeline

Ocaasi_WMF triaged this task as Medium priority.Nov 13 2017, 9:51 AM

Can also happen with pages which have been redirected in the meanwhile:

Oops! Something went wrong.
Invalid page. 
Traceback (most recent call last):
File "/data/project/oabot/www/python/venv/local/lib/python2.7/site-packages/flask/", line 1612, in full_dispatch_request
rv = self.dispatch_request()
File "/data/project/oabot/www/python/venv/local/lib/python2.7/site-packages/flask/", line 1598, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/data/project/oabot/www/python/src/", line 150, in review_one_edit
File "/data/project/oabot/www/python/src/", line 242, in get_one_proposed_edit
File "/data/project/oabot/www/python/src/", line 210, in get_proposed_edits
redirect_re = re.compile(r'#REDIRECT *\[\[(.*)\]\]')
File "./oabot/", line 302, in get_page_over_api
raise ValueError("Invalid page.")
ValueError: Invalid page.

For such cases, the best prevention is having fresh suggestions.