Skip to content

Commit

Permalink
Fix logging in DefaultDatabaseErrorHandler (ref: #169)
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Brody committed Aug 28, 2015
1 parent 0c88453 commit d22b5a4
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/net/sqlcipher/DefaultDatabaseErrorHandler.java
Expand Up @@ -42,14 +42,17 @@ public final class DefaultDatabaseErrorHandler implements DatabaseErrorHandler {
* is detected.
*/
public void onCorruption(SQLiteDatabase dbObj) {
Log.e(TAG, "Corruption reported by sqlite on database, deleting and re-creating: " + dbObj.getPath());
// NOTE: Unlike the AOSP, this version does NOT attempt to delete any attached databases.
// TBD: Are we really certain that the attached databases would really be corrupt?
Log.e(TAG, "Corruption reported by sqlite on database, deleting: " + dbObj.getPath());

if (dbObj.isOpen()) {
Log.e(TAG, "Database object for corrupted database is open, not expected for this implementation");
Log.e(TAG, "Database object for corrupted database is already open, closing");

try {
dbObj.close();
} catch (Exception e) {
/* ignore */
/* ignored */
Log.e(TAG, "Exception closing Database object for corrupted database, ignored", e);
}
}
Expand Down

0 comments on commit d22b5a4

Please sign in to comment.