Simplification

master
M66B 10 months ago
parent 1ec2fa467d
commit b69c395786

@ -160,16 +160,13 @@ 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 IllegalStateException) if (ex instanceof IllegalStateException || ex instanceof UnknownHostException)
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
Log.unexpectedError(getParentFragmentManager(), ex);
} }
}.execute(FragmentDialogUnsubscribe.this, args, "unsubscribe"); }.execute(FragmentDialogUnsubscribe.this, args, "unsubscribe");
} }

Loading…
Cancel
Save