Merge pull request #60 from jtleniger/fix-country-cache-permission-error

Fix unhandled exception when Windows API fails to delete cached counties DB
This commit is contained in:
Dan Paulat 2023-06-13 21:39:36 -05:00 committed by GitHub
commit 3885d0d650
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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