diff options
author | ByteHamster <info@bytehamster.com> | 2021-10-28 23:33:56 +0200 |
---|---|---|
committer | ByteHamster <info@bytehamster.com> | 2021-10-28 23:34:58 +0200 |
commit | f6fc2c6d73ad1750b9da98a3e4c54ce3111ca867 (patch) | |
tree | 644e4f3c21f04105faea7815c2b2924abdb3c327 | |
parent | 345aad4148f133477e40c232a8e855dfd28e0654 (diff) | |
download | AntennaPod-f6fc2c6d73ad1750b9da98a3e4c54ce3111ca867.zip |
Human-readable gpodder error message
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/fragment/gpodnet/PodcastListFragment.java | 2 | ||||
-rw-r--r-- | net/sync/gpoddernet/src/main/java/de/danoeh/antennapod/net/sync/gpoddernet/GpodnetService.java | 8 |
2 files changed, 8 insertions, 2 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/gpodnet/PodcastListFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/gpodnet/PodcastListFragment.java index af502ce13..c2c5adc9a 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/gpodnet/PodcastListFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/gpodnet/PodcastListFragment.java @@ -101,7 +101,7 @@ public abstract class PodcastListFragment extends Fragment { }, error -> { gridView.setVisibility(View.GONE); progressBar.setVisibility(View.GONE); - txtvError.setText(getString(R.string.error_msg_prefix) + error.getMessage()); + txtvError.setText(error.getMessage()); txtvError.setVisibility(View.VISIBLE); butRetry.setVisibility(View.VISIBLE); Log.e(TAG, Log.getStackTraceString(error)); diff --git a/net/sync/gpoddernet/src/main/java/de/danoeh/antennapod/net/sync/gpoddernet/GpodnetService.java b/net/sync/gpoddernet/src/main/java/de/danoeh/antennapod/net/sync/gpoddernet/GpodnetService.java index 439a528b7..21a362a40 100644 --- a/net/sync/gpoddernet/src/main/java/de/danoeh/antennapod/net/sync/gpoddernet/GpodnetService.java +++ b/net/sync/gpoddernet/src/main/java/de/danoeh/antennapod/net/sync/gpoddernet/GpodnetService.java @@ -588,7 +588,13 @@ public class GpodnetService implements ISyncService { e.printStackTrace(); } } - throw new GpodnetServiceBadStatusCodeException("Bad response code: " + responseCode, responseCode); + if (responseCode >= 500) { + throw new GpodnetServiceBadStatusCodeException("Gpodder.net is currently unavailable (code " + + responseCode + ")", responseCode); + } else { + throw new GpodnetServiceBadStatusCodeException("Unable to connect to Gpodder.net (code " + + responseCode + ": " + response.message() + ")", responseCode); + } } } } |