Catch exception

This commit is contained in:
LoveSy 2020-12-03 16:23:03 +08:00 committed by solohsu
parent 7362dbf921
commit 0d27117c95
1 changed files with 7 additions and 3 deletions

View File

@ -109,10 +109,14 @@ namespace edxp {
std::unordered_set<std::string> ConfigManager::GetAppList(const fs::path &dir) {
std::unordered_set<std::string> set;
for (auto &item: fs::directory_iterator(dir)) {
if (item.is_regular_file()) {
set.emplace(item.path().filename());
try {
for (auto &item: fs::directory_iterator(dir)) {
if (item.is_regular_file()) {
set.emplace(item.path().filename());
}
}
} catch (const fs::filesystem_error &e) {
LOGE("%s", e.what());
}
return set;
}