From dd5b3cac0e9f70d54d5028cced42101c2f6499bd Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Mon, 3 Aug 2020 13:10:08 +0200 Subject: [PATCH] Be more verbose about invalid type errors --- .../antennapod/activity/OnlineFeedViewActivity.java | 8 +++----- .../syndication/handler/UnsupportedFeedtypeException.java | 3 +++ 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/de/danoeh/antennapod/activity/OnlineFeedViewActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/OnlineFeedViewActivity.java index 58b2d6db1..beb6e0a9f 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/OnlineFeedViewActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/OnlineFeedViewActivity.java @@ -561,13 +561,11 @@ public class OnlineFeedViewActivity extends AppCompatActivity { AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setTitle(R.string.error_label); if (errorMsg != null) { - builder.setMessage(getString(R.string.error_msg_prefix) + errorMsg); + builder.setMessage(errorMsg); } else { - builder.setMessage(R.string.error_msg_prefix); + builder.setMessage(R.string.download_error_error_unknown); } - builder.setPositiveButton(android.R.string.ok, - (dialog, which) -> dialog.cancel() - ); + builder.setPositiveButton(android.R.string.ok, (dialog, which) -> dialog.cancel()); builder.setOnDismissListener(dialog -> { setResult(RESULT_ERROR); finish(); diff --git a/core/src/main/java/de/danoeh/antennapod/core/syndication/handler/UnsupportedFeedtypeException.java b/core/src/main/java/de/danoeh/antennapod/core/syndication/handler/UnsupportedFeedtypeException.java index c9f9f19c8..11588967a 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/syndication/handler/UnsupportedFeedtypeException.java +++ b/core/src/main/java/de/danoeh/antennapod/core/syndication/handler/UnsupportedFeedtypeException.java @@ -36,6 +36,9 @@ public class UnsupportedFeedtypeException extends Exception { if (message != null) { return message; } else if (type == TypeGetter.Type.INVALID) { + if ("html".equals(rootElement)) { + return "The server returned a website, not a podcast feed"; + } return "Invalid type"; } else { return "Type " + type + " not supported";