# HG changeset patch # User Paper # Date 1753455785 14400 # Node ID fbc8c617de808150f3bea2dc233ef2c9cf306458 # Parent a65a43766b22a2be4ad6a2802ee408244770d707 dep/animone: exception handling is the worst c++ anti-feature diff -r a65a43766b22 -r fbc8c617de80 dep/animone/src/fd/proc.cc --- a/dep/animone/src/fd/proc.cc Fri Jul 25 11:02:29 2025 -0400 +++ b/dep/animone/src/fd/proc.cc Fri Jul 25 11:03:05 2025 -0400 @@ -155,22 +155,27 @@ for (const auto& pid : pids) { const std::filesystem::path path = std::filesystem::path(PROC_LOCATION) / std::to_string(pid) / "fd"; - for (const auto& dir : std::filesystem::directory_iterator{path}) { - if (!AreFlagsOk(pid, util::StringToInt(dir.path().stem()))) - continue; + try { + for (const auto& dir : std::filesystem::directory_iterator{path}) { + if (!AreFlagsOk(pid, util::StringToInt(dir.path().stem()))) + continue; - std::string name; - if (!GetFilenameFromFd(dir.path(), name)) - continue; + std::string name; + if (!GetFilenameFromFd(dir.path(), name)) + continue; - if (!IsRegularFile(name)) - continue; + if (!IsRegularFile(name)) + continue; + + if (IsSystemFile(name)) + continue; - if (IsSystemFile(name)) - continue; - - if (!open_file_proc({pid, name})) - return false; + if (!open_file_proc({pid, name})) + return false; + } + } catch (std::filesystem::filesystem_error &fs_error) { + /* I hate C++ */ + continue; } } return true;