Merge "Ignore exceptions when investigating failure reasons" into rvc-dev am: d907c49479 am: f37ded68ae
Change-Id: Iebd2c7130bc80bd3507daab6a6c345eeeab7fbda
This commit is contained in:
@@ -228,6 +228,10 @@ public final class SQLiteConnection implements CancellationSignal.OnCancelListen
|
|||||||
} catch (SQLiteCantOpenDatabaseException e) {
|
} catch (SQLiteCantOpenDatabaseException e) {
|
||||||
String message = String.format("Cannot open database '%s'", file);
|
String message = String.format("Cannot open database '%s'", file);
|
||||||
|
|
||||||
|
try {
|
||||||
|
// Try to diagnose for common reasons. If something fails in here, that's fine;
|
||||||
|
// just swallow the exception.
|
||||||
|
|
||||||
final Path path = FileSystems.getDefault().getPath(file);
|
final Path path = FileSystems.getDefault().getPath(file);
|
||||||
final Path dir = path.getParent();
|
final Path dir = path.getParent();
|
||||||
|
|
||||||
@@ -242,6 +246,9 @@ public final class SQLiteConnection implements CancellationSignal.OnCancelListen
|
|||||||
} else {
|
} else {
|
||||||
message += ": Unknown reason";
|
message += ": Unknown reason";
|
||||||
}
|
}
|
||||||
|
} catch (Throwable th) {
|
||||||
|
message += ": Unknown reason; cannot examine filesystem: " + th.getMessage();
|
||||||
|
}
|
||||||
throw new SQLiteCantOpenDatabaseException(message, e);
|
throw new SQLiteCantOpenDatabaseException(message, e);
|
||||||
} finally {
|
} finally {
|
||||||
mRecentOperations.endOperation(cookie);
|
mRecentOperations.endOperation(cookie);
|
||||||
|
|||||||
Reference in New Issue
Block a user