Commit 3c09cbd8 by Balachandar KM Committed by GitHub

Handle SQLiteException when trying to accessing DatabaseProvider#getReadableDatabase()

parent eb8fffba
...@@ -794,11 +794,15 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull; ...@@ -794,11 +794,15 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
@Override @Override
public boolean exists() throws DatabaseIOException { public boolean exists() throws DatabaseIOException {
return VersionTable.getVersion( try {
databaseProvider.getReadableDatabase(), return VersionTable.getVersion(
VersionTable.FEATURE_CACHE_CONTENT_METADATA, databaseProvider.getReadableDatabase(),
checkNotNull(hexUid)) VersionTable.FEATURE_CACHE_CONTENT_METADATA,
!= VersionTable.VERSION_UNSET; checkNotNull(hexUid))
!= VersionTable.VERSION_UNSET;
} catch (SQLiteException e) {
throw new DatabaseIOException(e);
}
} }
@Override @Override
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment