catch errors when the custom caching directory is not accessible

🧯
This commit is contained in:
Lion Kortlepel 2024-09-23 22:39:44 +02:00
parent 1362471657
commit 19d1245379
No known key found for this signature in database
GPG Key ID: 4322FF2B4C71259B
2 changed files with 9 additions and 3 deletions

View File

@ -37,7 +37,13 @@ namespace fs = std::filesystem;
void CheckForDir() {
if (!fs::exists(CachingDirectory)) {
fs::create_directory(CachingDirectory);
try {
fs::create_directories(CachingDirectory);
} catch (const std::exception& e) {
error(std::string("Failed to create caching directory: ") + e.what() + ". This is a fatal error. Please make sure to configure a directory which you have permission to create, read and write from/to.");
std::this_thread::sleep_for(std::chrono::seconds(3));
std::exit(1);
}
}
}
void WaitForConfirm() {

View File

@ -81,10 +81,10 @@ std::string GetEN() {
}
std::string GetVer() {
return "2.0";
return "2.1";
}
std::string GetPatch() {
return ".99";
return ".0";
}
std::string GetEP(char* P) {