ACRA/acra — pull request #176 by hannesa2 (2014-08-23 12:07:14+00:00)
Title: react on specific exceptions

With this, I'm able to handle specific exception with unclear source and independent form where it comes.

ACRA.getErrorReporter().setExceptionHandlerInitializer(new ExceptionHandlerInitializer() {

@Override
public boolean initializeExceptionHandler(ErrorReporter reporter, Throwable e) {
if (e.getCause() instanceof ActivityNotFoundException) {
return false;
} else if (e.getCause() instanceof SQLiteDatabaseCorruptException) {
doRepairDatabase(); // my motivation
return false;
} else if (e.getCause() instanceof ArithmeticException) {
final ACRAConfiguration conf = ACRA.getConfig();
conf.setResToastText(R.string.show_different_text);
ACRA.setConfig(conf);
return true;
} else {
return true;
}
}
});