Simplify error message.
This commit is contained in:
parent
dc6d9822a2
commit
f8402d5d9d
@ -20,9 +20,9 @@ SqliteConnectionSafe::SqliteConnectionSafe(string path, DbKey key, optional<int3
|
||||
if (r_db.is_error()) {
|
||||
auto r_stat = stat(path);
|
||||
if (r_stat.is_error()) {
|
||||
LOG(FATAL) << "Can't open database (" << r_stat.error() << "): " << r_db.error();
|
||||
LOG(FATAL) << "Can't open database (" << r_stat.error() << "): " << r_db.error().message();
|
||||
} else {
|
||||
LOG(FATAL) << "Can't open database of size " << r_stat.ok().size_ << ": " << r_db.error();
|
||||
LOG(FATAL) << "Can't open database of size " << r_stat.ok().size_ << ": " << r_db.error().message();
|
||||
}
|
||||
}
|
||||
auto db = r_db.move_as_ok();
|
||||
|
@ -86,7 +86,7 @@ Status SqliteDb::init(CSlice path, bool *was_created) {
|
||||
int rc = sqlite3_open_v2(path.c_str(), &db, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE /*| SQLITE_OPEN_SHAREDCACHE*/,
|
||||
nullptr);
|
||||
if (rc != SQLITE_OK) {
|
||||
auto res = Status::Error(PSLICE() << "Failed to open database: " << detail::RawSqliteDb::last_error(db, path));
|
||||
auto res = detail::RawSqliteDb::last_error(db, path);
|
||||
sqlite3_close(db);
|
||||
return res;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user