Commit 8167bdd9 authored by Max Kellermann's avatar Max Kellermann

db/simple: handle Database::Open() exceptions in Mount()

parent dfb3e34f
......@@ -471,9 +471,14 @@ SimpleDatabase::Mount(const char *local_uri, const char *storage_uri,
auto db = new SimpleDatabase(AllocatedPath::Build(cache_path,
name_fs.c_str()),
compress);
if (!db->Open(error)) {
try {
if (!db->Open(error)) {
delete db;
return false;
}
} catch (...) {
delete db;
return false;
throw;
}
// TODO: update the new database instance?
......
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 to comment