Merge pull request #5499 from ByteHamster/gpodder-error-message

Human-readable gpodder error message
This commit is contained in:
ByteHamster 2021-10-30 11:49:14 +02:00 committed by GitHub
commit 57c172e47e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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);
}
}
}
}