Be more verbose about invalid type errors

This commit is contained in:
ByteHamster 2020-08-03 13:10:08 +02:00
parent de70873e96
commit dd5b3cac0e
2 changed files with 6 additions and 5 deletions

View File

@ -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();

View File

@ -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";