From f33ef4e3eedf3c6607214acdf833ee206c176691 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin <dmitry.kalinkin@gmail.com> Date: Tue, 12 May 2020 16:50:17 -0400 Subject: [PATCH] Glob: issue warnings on Directory errors The current implementation HandleGlobImpl with throw fatal errors for all Glob::MessageType other than cyclicRecursion. This will need to be addressed in cmake. --- Glob.cxx | 8 +++++++- Glob.hxx.in | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Glob.cxx b/Glob.cxx index 8e30f92f..364305f5 100644 --- a/Glob.cxx +++ b/Glob.cxx @@ -182,7 +182,13 @@ bool Glob::RecurseDirectory(std::string::size_type start, const std::string& dir, GlobMessages* messages) { kwsys::Directory d; - if (!d.Load(dir)) { + std::string errorMessage; + if (!d.Load(dir, &errorMessage)) { + if (!errorMessage.empty()) { + messages->push_back(Message(Glob::warning, + "Error listing directory '" + dir + + "'! Reason: '" + errorMessage + "'")); + } return true; } unsigned long cc; diff --git a/Glob.hxx.in b/Glob.hxx.in index 170766f4..b5a34d59 100644 --- a/Glob.hxx.in +++ b/Glob.hxx.in @@ -28,6 +28,7 @@ public: enum MessageType { error, + warning, cyclicRecursion }; -- GitLab