From f6fc2c6d73ad1750b9da98a3e4c54ce3111ca867 Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Thu, 28 Oct 2021 23:33:56 +0200 Subject: Human-readable gpodder error message --- .../de/danoeh/antennapod/net/sync/gpoddernet/GpodnetService.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'net/sync') 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); + } } } } -- cgit v1.2.3