Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Display specific, user-friendly error message when upload categories search API call returns an error #6540

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

@ted-gilbert
Copy link
Contributor

@ted-gilbert ted-gilbert commented Oct 24, 2025

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.

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. 🙂

ted-gilbert reacted with hooray emoji
@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

Reviewers

@nicolas-raoul nicolas-raoul nicolas-raoul approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

[Bug]: during upload autocomplete of categories loads forever

AltStyle によって変換されたページ (->オリジナル) /