Human-readable gpodder error message

This commit is contained in:
ByteHamster 2021-10-28 23:33:56 +02:00
parent 345aad4148
commit f6fc2c6d73
2 changed files with 8 additions and 2 deletions

View File

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

View File

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