Simplify error message.

This commit is contained in:
levlam 2021-09-22 14:56:48 +03:00
parent dc6d9822a2
commit f8402d5d9d
2 changed files with 3 additions and 3 deletions

View File

@ -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();

View File

@ -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;
}