Unsubscribe: improved error message (2)

master
M66B 1 week ago
parent b3a0b66398
commit 0de6425164

@ -33,6 +33,7 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.appcompat.app.AlertDialog; import androidx.appcompat.app.AlertDialog;
import java.net.ConnectException;
import java.net.HttpURLConnection; import java.net.HttpURLConnection;
import java.net.URL; import java.net.URL;
import java.net.URLDecoder; import java.net.URLDecoder;
@ -149,7 +150,7 @@ public class FragmentDialogUnsubscribe extends FragmentDialogBase {
@Override @Override
protected void onException(Bundle args, Throwable ex) { protected void onException(Bundle args, Throwable ex) {
dialog.dismiss(); dialog.dismiss();
if (ex instanceof IllegalArgumentException) if (ex instanceof IllegalArgumentException || ex instanceof ConnectException)
ToastEx.makeText(context, ToastEx.makeText(context,
context.getString(R.string.title_unsubscribe_error, ex.getMessage()), context.getString(R.string.title_unsubscribe_error, ex.getMessage()),
Toast.LENGTH_LONG).show(); Toast.LENGTH_LONG).show();

Loading…
Cancel
Save