Page MenuHomePhabricator

Add error-handling to commons-selection.js
Closed, ResolvedPublic


If MediaWiki API replies with an error, commons-selection.js can't deal with it. The user then sees "Loading..." forever. An error message would do. The error message should recommend disconnecting and reconnecting of Wikimedia account.

Example error reply, happens when user have old OAuth token.

{"error":{"code":"mwoauth-invalid-authorization","info":"The authorization headers in your request are not valid: No approved grant was found for that authorization token.","*":"See for API usage. Subscribe to the mediawiki-api-announce mailing list at <> for notice of API deprecations and breaking changes."},"servedby":"mw1228"}


Related Gerrit Patches:

Event Timeline

Urbanecm created this task.May 8 2019, 11:18 AM
Urbanecm triaged this task as Medium priority.
Urbanecm moved this task from Inbox to Bugs on the WMCZ-Tracker board.

Per IRC.

Change 509637 had a related patch set uploaded (by Shreyasminocha; owner: Shreyasminocha):
[wikimedia-cz/tracker@master] Add error handling to Commons selection interface

Change 529615 had a related patch set uploaded (by Urbanecm; owner: Urbanecm):
[wikimedia-cz/tracker@master] Add error handling to commons-selection.js

Change 509637 abandoned by Urbanecm:
Add error handling to Commons selection interface

submitted /529615 instead

Urbanecm claimed this task.Aug 11 2019, 7:53 PM
Urbanecm added a subscriber: Shreyasminocha.
Restricted Application added a project: User-Urbanecm. · View Herald TranscriptAug 11 2019, 7:53 PM

Change 529615 merged by jenkins-bot:
[wikimedia-cz/tracker@master] Add error handling to commons-selection.js

Urbanecm closed this task as Resolved.Aug 11 2019, 7:54 PM

Apologies for not being able to make the changes you pointed out recently in time.
Thanks for completing this.

No problem, I totally understand you have a lot of things to do :-). When doing T229269, I introduced a bug, which I fixed in, but for users it was like "nothing is happening", so I added a try catch to catch all possible fatals. Feel free to add more descriptive errors if you feel it's needed :-).