mirror of
https://github.com/M66B/FairEmail.git
synced 2025-03-03 18:26:20 +00:00
Expected exceptions
This commit is contained in:
parent
6c00f0e922
commit
522af0c756
1 changed files with 15 additions and 12 deletions
|
@ -686,11 +686,11 @@ public class ActivitySetup extends ActivityBase implements FragmentManager.OnBac
|
|||
|
||||
@Override
|
||||
protected void onException(Bundle args, Throwable ex) {
|
||||
if (ex instanceof IllegalArgumentException ||
|
||||
ex instanceof FileNotFoundException)
|
||||
ToastEx.makeText(ActivitySetup.this, ex.getMessage(), Toast.LENGTH_LONG).show();
|
||||
else
|
||||
Log.unexpectedError(getSupportFragmentManager(), ex);
|
||||
boolean expected =
|
||||
(ex instanceof IllegalArgumentException ||
|
||||
ex instanceof FileNotFoundException ||
|
||||
ex instanceof SecurityException);
|
||||
Log.unexpectedError(getSupportFragmentManager(), ex, !expected);
|
||||
}
|
||||
}.execute(this, args, "setup:export");
|
||||
}
|
||||
|
@ -1073,12 +1073,14 @@ public class ActivitySetup extends ActivityBase implements FragmentManager.OnBac
|
|||
ToastEx.makeText(ActivitySetup.this, R.string.title_setup_password_invalid, Toast.LENGTH_LONG).show();
|
||||
else if (ex instanceof IOException && ex.getCause() instanceof IllegalBlockSizeException)
|
||||
ToastEx.makeText(ActivitySetup.this, R.string.title_setup_import_invalid, Toast.LENGTH_LONG).show();
|
||||
else if (ex instanceof IllegalArgumentException ||
|
||||
ex instanceof FileNotFoundException ||
|
||||
ex instanceof JSONException)
|
||||
ToastEx.makeText(ActivitySetup.this, ex.getMessage(), Toast.LENGTH_LONG).show();
|
||||
else
|
||||
Log.unexpectedError(getSupportFragmentManager(), ex);
|
||||
else {
|
||||
boolean expected =
|
||||
(ex instanceof IllegalArgumentException ||
|
||||
ex instanceof FileNotFoundException ||
|
||||
ex instanceof JSONException ||
|
||||
ex instanceof SecurityException);
|
||||
Log.unexpectedError(getSupportFragmentManager(), ex, !expected);
|
||||
}
|
||||
}
|
||||
}.execute(this, args, "setup:import");
|
||||
}
|
||||
|
@ -1145,7 +1147,8 @@ public class ActivitySetup extends ActivityBase implements FragmentManager.OnBac
|
|||
|
||||
@Override
|
||||
protected void onException(Bundle args, Throwable ex) {
|
||||
Log.unexpectedError(getSupportFragmentManager(), ex, false);
|
||||
boolean expected = (ex instanceof SecurityException);
|
||||
Log.unexpectedError(getSupportFragmentManager(), ex, !expected);
|
||||
}
|
||||
}.execute(this, args, "setup:cert");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue