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,11 +163,12 @@ 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)
if (!(ex instanceof UnknownHostException)) {
ToastEx.makeText(context, ToastEx.makeText(context,
context.getString(R.string.title_unsubscribe_error, context.getString(R.string.title_unsubscribe_error,
Log.formatThrowable(ex, false)), Log.formatThrowable(ex, false)),
Toast.LENGTH_LONG).show(); Toast.LENGTH_LONG).show();
else } else
Log.unexpectedError(getParentFragmentManager(), ex); Log.unexpectedError(getParentFragmentManager(), ex);
} }
}.execute(FragmentDialogUnsubscribe.this, args, "unsubscribe"); }.execute(FragmentDialogUnsubscribe.this, args, "unsubscribe");

Loading…
Cancel
Save