Skip to content

Commit

Permalink
Improve error message.
Browse files Browse the repository at this point in the history
  • Loading branch information
levlam committed Nov 14, 2021
1 parent ed56a75 commit 43855f0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tddb/td/db/SqliteDb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ SqliteDb::~SqliteDb() = default;

Status SqliteDb::init(CSlice path, bool allow_creation) {
// if database does not exist, delete all other files which could have been left from the old database
bool is_db_exists = stat(path).is_ok();
if (!is_db_exists) {
auto database_stat = stat(path);
if (database_stat.is_error()) {
if (!allow_creation) {
LOG(FATAL) << "Database was deleted during execution and can't be recreated";
LOG(FATAL) << "Database was deleted during execution and can't be recreated: " << database_stat.error();
}
TRY_STATUS(destroy(path));
}
Expand Down

0 comments on commit 43855f0

Please sign in to comment.