Simplification

This commit is contained in:
M66B
2025-11-12 09:30:40 +01:00
parent 1ec2fa467d
commit b69c395786

View File

@@ -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");
}