Skip to content

Commit c8dde33

Browse files
committed
Finding circular symlinks (and other failures).
1 parent 893f271 commit c8dde33

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

util/src/parserutil.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,17 +50,17 @@ bool iterateDirectoryRecursive(
5050

5151
fs::path p(path_);
5252

53-
try
53+
boost::system::error_code ec;
54+
auto target = fs::canonical(p, ec);
55+
if (ec)
5456
{
55-
if (!fs::exists(p))
56-
{
57-
LOG(warning) << "Not found: " << p;
58-
return true;
59-
}
57+
LOG(warning) << p << ": " << ec.message();
58+
return true;
6059
}
61-
catch (const std::exception& ex_)
60+
61+
if (!fs::exists(p))
6262
{
63-
LOG(warning) << "Parser threw an exception: " << ex_.what();
63+
LOG(warning) << "Not found: " << p;
6464
return true;
6565
}
6666

0 commit comments

Comments
 (0)