Fix unhandled exception when Windows API fails to delete cached countries DB.

This commit is contained in:
Justin Leniger 2023-06-13 18:13:01 -06:00
parent a5df5a237e
commit 54941e028f

View file

@ -129,7 +129,14 @@ void Initialize()
sqlite3_close(db); sqlite3_close(db);
// Remove temporary file // Remove temporary file
std::filesystem::remove(countyDatabaseCache); std::error_code err;
if (!std::filesystem::remove(countyDatabaseCache, err)) {
logger_->error(
"Unable to remove cached copy of database, error code: {} error category: {}",
err.value(),
err.category().name());
}
initialized_ = true; initialized_ = true;
} }