From c0a9e5134afb3673b59ac6eb20d87d83ade713fb Mon Sep 17 00:00:00 2001 From: Ted Gilbert Date: Sat, 25 Oct 2025 10:35:49 +1100 Subject: [PATCH] Add error handling when API call fails to CategoriesPresenter.onAttachViewWithMedia --- .../nrw/commons/upload/categories/CategoriesPresenter.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/fr/free/nrw/commons/upload/categories/CategoriesPresenter.kt b/app/src/main/java/fr/free/nrw/commons/upload/categories/CategoriesPresenter.kt index a7c103a66..a1a96f2ac 100644 --- a/app/src/main/java/fr/free/nrw/commons/upload/categories/CategoriesPresenter.kt +++ b/app/src/main/java/fr/free/nrw/commons/upload/categories/CategoriesPresenter.kt @@ -200,7 +200,12 @@ class CategoriesPresenter }, { t: Throwable? -> view.showProgress(false) - view.showError(R.string.no_categories_found) + view.showError(R.string.error_loading_categories) + val mwException = t as? MwIOException + view.showErrorDialog( + if (mwException == null) "" + else "\n${mwException.error.title} / ${mwException.error.details}" + ) Timber.e(t) }, ),