diff options
author | Stefan Niedermann <info@niedermann.it> | 2020-07-04 22:02:50 +0300 |
---|---|---|
committer | Stefan Niedermann <info@niedermann.it> | 2020-07-04 22:02:50 +0300 |
commit | 6cf7a252e57bfea325101ff5d2f9bfca36099171 (patch) | |
tree | bd0a6babff66a6ff78542d96925097a56565e724 | |
parent | c831b4eec7edd63c82b73898ee8c879026abb81f (diff) |
Report bugs on failed database upgrade
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/ui/exception/tips/TipsAdapter.java | 10 | ||||
-rw-r--r-- | app/src/main/res/values/strings.xml | 3 |
2 files changed, 13 insertions, 0 deletions
diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/exception/tips/TipsAdapter.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/exception/tips/TipsAdapter.java index fa4113b1e..a059b2956 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/exception/tips/TipsAdapter.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/exception/tips/TipsAdapter.java @@ -133,6 +133,16 @@ public class TipsAdapter extends RecyclerView.Adapter<TipsViewHolder> { add(R.string.error_dialog_capabilities_not_parsable); } } + } else if (throwable instanceof RuntimeException) { + if (throwable.getMessage() != null && throwable.getMessage().contains("database")) { + Intent reportIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(context.getString(R.string.url_report_bug))) + .putExtra(INTENT_EXTRA_BUTTON_TEXT, R.string.error_action_report_issue); + add(R.string.error_dialog_tip_database_upgrade_failed, reportIntent); + Intent clearIntent = new Intent(ACTION_APPLICATION_DETAILS_SETTINGS) + .setData(Uri.parse("package:" + BuildConfig.APPLICATION_ID)) + .putExtra(INTENT_EXTRA_BUTTON_TEXT, R.string.error_action_open_deck_info); + add(R.string.error_dialog_tip_clear_storage, clearIntent); + } } } diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 51cd41e20..256f9bc91 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -114,6 +114,7 @@ <string name="url_about_icon_author" translatable="false">https://github.com/nextcloud/deck/commit/8c04ea8dc99e9b392f4039e8e5e6964d5a6d3453#diff-f3716cc279904617b1a21078526b6bf1R1</string> <string name="url_source" translatable="false">https://github.com/stefan-niedermann/nextcloud-deck</string> <string name="url_issues" translatable="false">https://github.com/stefan-niedermann/nextcloud-deck/issues/new/choose</string> + <string name="url_report_bug" translatable="false">https://github.com/stefan-niedermann/nextcloud-deck/issues/new?labels=bug&template=bug_report.md</string> <string name="url_license" translatable="false">https://github.com/stefan-niedermann/nextcloud-deck/blob/master/LICENSE</string> <string name="url_translations" translatable="false">https://www.transifex.com/nextcloud/nextcloud/</string> <string name="url_about_icons_disclaimer_mdi" translatable="false">https://materialdesignicons.com/</string> @@ -241,6 +242,7 @@ <string name="error_dialog_title">Oh no - What now? 🙁</string> <string name="error_dialog_tip_token_mismatch_retry">Please try to force close the app and restart it again. There might have been an incorrect connection to the Nextcloud app.</string> <string name="error_dialog_tip_token_mismatch_clear_storage">If the issue persists, try to clear the storage of both apps: Nextcloud and Nextcloud Deck to solve this issue.</string> + <string name="error_dialog_tip_database_upgrade_failed">The ugprade of the database failed. Please report the issue and clear the storage to use the app normally.</string> <string name="error_dialog_tip_clear_storage">You can clear the storage by opening the app info and selecting Storage → Clear storage.</string> <string name="error_dialog_tip_files_outdated">Your Nextcloud app seems to be outdated. Please visit the Play Store or F-Droid to get the latest version.</string> <string name="error_dialog_tip_files_force_stop">Something seems to be wrong with your Nextcloud app. Please try to force stop both, the Nextcloud app and the Nextcloud Deck app.</string> @@ -261,6 +263,7 @@ <string name="error_action_open_network">Network settings</string> <string name="error_action_server_logs">Server logs</string> <string name="error_action_install">Install</string> + <string name="error_action_report_issue">Report</string> <string name="info_box_maintenance_mode">Server in maintenance mode</string> <string name="info_box_version_not_supported">Server version %1$s not supported, please update to %2$s</string> <string name="share_link">Share link</string> |