Skip to content

Conversation

@ted-gilbert
Copy link
Contributor

Description (required)

Fixes #5225

What changes did you make and why?

Modified the error handling in UnsuccessfulResponseInterceptor.intercept so that MwIOException is raised for non-suppressed errors. The error code and details are parsed into a MwLegacyServiceError object, which is attached to MwIOException.

Added a method, showErrorDialog(String) to UploadCategoriesFragment and CategoriesContract which displays an AlertDialog stating that an error has occurred while loading categories and showing a specific error message.

Added handling to CategoriesPresenter in onAttachView and onAttachViewWithMedia which displays an alert with the specific MediaWiki API error when the categories search throws MwIOException.

Tests performed (required)

Tested betaDebug on Medium Phone with API level 35.
Tested prodDebug on Medium Phone with API level 35.

Screenshots (for UI changes only)

Categories upload UI showing alert dialog with specific API error

Need help? See https://support.google.com/android/answer/9075928


Note: Please ensure that you have read CONTRIBUTING.md if this is your first pull request.

@github-actions
Copy link

✅ Generated APK variants!

Copy link
Member

@nicolas-raoul nicolas-raoul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! I did not go as far as voluntarily trigger an error, but at least it works for successful search and category not found. 🙂

@nicolas-raoul nicolas-raoul merged commit 28fa7b1 into commons-app:main Oct 25, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: during upload autocomplete of categories loads forever

2 participants