mirror of https://github.com/M66B/FairEmail.git
Expected exceptions
This commit is contained in:
parent
6c00f0e922
commit
522af0c756
|
@ -686,11 +686,11 @@ public class ActivitySetup extends ActivityBase implements FragmentManager.OnBac
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onException(Bundle args, Throwable ex) {
|
protected void onException(Bundle args, Throwable ex) {
|
||||||
if (ex instanceof IllegalArgumentException ||
|
boolean expected =
|
||||||
ex instanceof FileNotFoundException)
|
(ex instanceof IllegalArgumentException ||
|
||||||
ToastEx.makeText(ActivitySetup.this, ex.getMessage(), Toast.LENGTH_LONG).show();
|
ex instanceof FileNotFoundException ||
|
||||||
else
|
ex instanceof SecurityException);
|
||||||
Log.unexpectedError(getSupportFragmentManager(), ex);
|
Log.unexpectedError(getSupportFragmentManager(), ex, !expected);
|
||||||
}
|
}
|
||||||
}.execute(this, args, "setup:export");
|
}.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();
|
ToastEx.makeText(ActivitySetup.this, R.string.title_setup_password_invalid, Toast.LENGTH_LONG).show();
|
||||||
else if (ex instanceof IOException && ex.getCause() instanceof IllegalBlockSizeException)
|
else if (ex instanceof IOException && ex.getCause() instanceof IllegalBlockSizeException)
|
||||||
ToastEx.makeText(ActivitySetup.this, R.string.title_setup_import_invalid, Toast.LENGTH_LONG).show();
|
ToastEx.makeText(ActivitySetup.this, R.string.title_setup_import_invalid, Toast.LENGTH_LONG).show();
|
||||||
else if (ex instanceof IllegalArgumentException ||
|
else {
|
||||||
|
boolean expected =
|
||||||
|
(ex instanceof IllegalArgumentException ||
|
||||||
ex instanceof FileNotFoundException ||
|
ex instanceof FileNotFoundException ||
|
||||||
ex instanceof JSONException)
|
ex instanceof JSONException ||
|
||||||
ToastEx.makeText(ActivitySetup.this, ex.getMessage(), Toast.LENGTH_LONG).show();
|
ex instanceof SecurityException);
|
||||||
else
|
Log.unexpectedError(getSupportFragmentManager(), ex, !expected);
|
||||||
Log.unexpectedError(getSupportFragmentManager(), ex);
|
}
|
||||||
}
|
}
|
||||||
}.execute(this, args, "setup:import");
|
}.execute(this, args, "setup:import");
|
||||||
}
|
}
|
||||||
|
@ -1145,7 +1147,8 @@ public class ActivitySetup extends ActivityBase implements FragmentManager.OnBac
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onException(Bundle args, Throwable ex) {
|
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");
|
}.execute(this, args, "setup:cert");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue