Delete only corrupt databases

This commit is contained in:
M66B
2023-12-22 15:56:21 +01:00
parent 2c4eb99d6a
commit 33be622f3e
2 changed files with 4 additions and 6 deletions

View File

@@ -522,7 +522,7 @@ public abstract class DB extends RoomDatabase {
dropTriggers(db);
createTriggers(db);
} catch (SQLiteException ex) {
} catch (Throwable ex) {
/*
at eu.faircode.email.DB$6.onOpen(DB.java:522)
at eu.faircode.email.DB_Impl$1.onOpen(DB_Impl.java:171)
@@ -538,10 +538,7 @@ public abstract class DB extends RoomDatabase {
*/
Log.e(ex);
// FrameworkSQLiteOpenHelper.innerGetDatabase will delete the database
if (ex instanceof SQLiteDatabaseCorruptException)
throw ex;
else
throw new RuntimeException("Open failed", ex);
throw ex;
}
}