Simplification

master
M66B 5 months ago
parent 1ec2fa467d
commit b69c395786

@ -160,16 +160,13 @@ public class FragmentDialogUnsubscribe extends FragmentDialogBase {
@Override
protected void onException(Bundle args, Throwable ex) {
dialog.dismiss();
if (ex instanceof IllegalStateException)
if (ex instanceof IllegalStateException || ex instanceof UnknownHostException)
ToastEx.makeText(context, ex.getMessage(), Toast.LENGTH_LONG).show();
else if (ex instanceof IllegalArgumentException || ex instanceof IOException)
if (!(ex instanceof UnknownHostException)) {
ToastEx.makeText(context,
context.getString(R.string.title_unsubscribe_error,
Log.formatThrowable(ex, false)),
Toast.LENGTH_LONG).show();
} else
Log.unexpectedError(getParentFragmentManager(), ex);
ToastEx.makeText(context,
context.getString(R.string.title_unsubscribe_error,
Log.formatThrowable(ex, false)),
Toast.LENGTH_LONG).show();
}
}.execute(FragmentDialogUnsubscribe.this, args, "unsubscribe");
}

Loading…
Cancel
Save