Ignore unknown host for unsubscribe

master
M66B 2 days ago
parent 462ec27291
commit eb07693f8e

@ -42,6 +42,7 @@ import java.io.IOException;
import java.net.HttpURLConnection; import java.net.HttpURLConnection;
import java.net.URL; import java.net.URL;
import java.net.URLDecoder; import java.net.URLDecoder;
import java.net.UnknownHostException;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
public class FragmentDialogUnsubscribe extends FragmentDialogBase { public class FragmentDialogUnsubscribe extends FragmentDialogBase {
@ -162,12 +163,13 @@ public class FragmentDialogUnsubscribe extends FragmentDialogBase {
if (ex instanceof IllegalStateException) if (ex instanceof IllegalStateException)
ToastEx.makeText(context, ex.getMessage(), Toast.LENGTH_LONG).show(); ToastEx.makeText(context, ex.getMessage(), Toast.LENGTH_LONG).show();
else if (ex instanceof IllegalArgumentException || ex instanceof IOException) else if (ex instanceof IllegalArgumentException || ex instanceof IOException)
ToastEx.makeText(context, if (!(ex instanceof UnknownHostException)) {
context.getString(R.string.title_unsubscribe_error, ToastEx.makeText(context,
Log.formatThrowable(ex, false)), context.getString(R.string.title_unsubscribe_error,
Toast.LENGTH_LONG).show(); Log.formatThrowable(ex, false)),
else Toast.LENGTH_LONG).show();
Log.unexpectedError(getParentFragmentManager(), ex); } else
Log.unexpectedError(getParentFragmentManager(), ex);
} }
}.execute(FragmentDialogUnsubscribe.this, args, "unsubscribe"); }.execute(FragmentDialogUnsubscribe.this, args, "unsubscribe");
} }

Loading…
Cancel
Save