From 231f4c0efb6de315380cd3fbcbf7b2bee3dd241d Mon Sep 17 00:00:00 2001 From: Kevin Meyer Date: Thu, 13 Nov 2014 20:56:06 +0100 Subject: [PATCH] show error messages when feed downloading is not successful. --- app/src/main/java/fr/gaulupeau/apps/Poche/Poche.java | 9 ++++++++- app/src/main/res/values-de/strings.xml | 1 + app/src/main/res/values/strings.xml | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/fr/gaulupeau/apps/Poche/Poche.java b/app/src/main/java/fr/gaulupeau/apps/Poche/Poche.java index 39d0fbf..abaf227 100644 --- a/app/src/main/java/fr/gaulupeau/apps/Poche/Poche.java +++ b/app/src/main/java/fr/gaulupeau/apps/Poche/Poche.java @@ -497,8 +497,15 @@ public class Poche extends Activity { } } + showToast(getString(R.string.txtSyncDone)); + } else { + // HTTP Connection not successful + if (urlConnection == null) { + showErrorMessage(getString(R.string.error_feed)); + } else { + showErrorMessage(getString(R.string.error_feed) + ":\n" + urlConnection.getResponseCode() + " " + urlConnection.getResponseMessage()); + } } - showToast(getString(R.string.txtSyncDone)); updateUnread(); } catch (Exception e) { e.printStackTrace(); diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 4967c40..dddcc4b 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -20,4 +20,5 @@ Deine User ID: Dein Token: Fehler + Fehler beim laden des Feeds diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index dfdfccd..e8f7bb4 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -20,4 +20,5 @@ Your User ID: Your Token: Error + Error loading feed