From 43855f0ce48bed3b3d10a2bb007298cb56db7e24 Mon Sep 17 00:00:00 2001 From: levlam Date: Sun, 14 Nov 2021 10:07:04 +0300 Subject: [PATCH] Improve error message. --- tddb/td/db/SqliteDb.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tddb/td/db/SqliteDb.cpp b/tddb/td/db/SqliteDb.cpp index e282ce4b9..910374b26 100644 --- a/tddb/td/db/SqliteDb.cpp +++ b/tddb/td/db/SqliteDb.cpp @@ -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)); }