Throwing an exception if the file does not exist

This commit is contained in:
Vladyslav Baranovskyi
2024-10-14 12:57:42 +03:00
parent 18c02d268f
commit 5c19eb964c

View File

@@ -88,7 +88,7 @@ namespace OpenVulkano
else if (archiveResult <= ARCHIVE_FAILED) lvl = spdlog::level::level_enum::err; else if (archiveResult <= ARCHIVE_FAILED) lvl = spdlog::level::level_enum::err;
const char* errorString = archive_error_string(arch); const char* errorString = archive_error_string(arch);
if (logger) logger->log(lvl, errorString ? errorString : "Unknown error while handling archive"); if (logger) logger->log(lvl, errorString ? errorString : "Unknown error while handling archive");
if (archiveResult == ARCHIVE_FAILED) throw std::runtime_error(errorString); if (archiveResult == ARCHIVE_FAILED || archiveResult == ARCHIVE_FATAL) throw std::runtime_error(errorString);
return false; return false;
} }
} }