Skip to content

Commit d22b5a4

Browse files
author
Chris Brody
committed
Fix logging in DefaultDatabaseErrorHandler (ref: sqlcipher#169)
1 parent 0c88453 commit d22b5a4

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/net/sqlcipher/DefaultDatabaseErrorHandler.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,17 @@ public final class DefaultDatabaseErrorHandler implements DatabaseErrorHandler {
4242
* is detected.
4343
*/
4444
public void onCorruption(SQLiteDatabase dbObj) {
45-
Log.e(TAG, "Corruption reported by sqlite on database, deleting and re-creating: " + dbObj.getPath());
45+
// NOTE: Unlike the AOSP, this version does NOT attempt to delete any attached databases.
46+
// TBD: Are we really certain that the attached databases would really be corrupt?
47+
Log.e(TAG, "Corruption reported by sqlite on database, deleting: " + dbObj.getPath());
4648

4749
if (dbObj.isOpen()) {
48-
Log.e(TAG, "Database object for corrupted database is open, not expected for this implementation");
50+
Log.e(TAG, "Database object for corrupted database is already open, closing");
51+
4952
try {
5053
dbObj.close();
5154
} catch (Exception e) {
52-
/* ignore */
55+
/* ignored */
5356
Log.e(TAG, "Exception closing Database object for corrupted database, ignored", e);
5457
}
5558
}

0 commit comments

Comments
 (0)