try to catch even more exceptions

This commit is contained in:
Green Sky 2025-04-19 14:45:30 +02:00
parent f35a97c33c
commit 7021e092b1
No known key found for this signature in database
GPG Key ID: DBE05085D874AB4A

View File

@ -138,6 +138,7 @@ void FileSelector::render(void) {
cd.file_path = path;
auto& dirs = cd.dirs;
auto& files = cd.files;
try {
for (auto const& dir_entry : std::filesystem::directory_iterator(path)) {
if (dir_entry.is_directory()) {
dirs.push_back(dir_entry);
@ -146,7 +147,6 @@ void FileSelector::render(void) {
}
}
try {
// do sorting here
if (sorts_specs != nullptr && sorts_specs->SpecsCount >= 1) {
switch (static_cast<SortID>(sorts_specs->Specs->ColumnUserID)) {
@ -197,8 +197,9 @@ void FileSelector::render(void) {
break; default: ;
}
}
} catch (...) {
} catch (std::filesystem::filesystem_error const& ex) {
// we likely saw a file disapear
std::cerr << "FS thread exception: " << ex.what() << "\n";
}
return cd;