From: Gunnar Beutner Date: Fri, 30 Aug 2013 12:02:47 +0000 (+0200) Subject: config: Don't throw exception when file pattern doesn't match any files. X-Git-Tag: v0.0.3~642 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=59d979c61eb05c72dff9b5c00e67d54d25408f97;p=icinga2 config: Don't throw exception when file pattern doesn't match any files. --- diff --git a/lib/config/configcompiler.cpp b/lib/config/configcompiler.cpp index 33036b55e..42c2c5156 100644 --- a/lib/config/configcompiler.cpp +++ b/lib/config/configcompiler.cpp @@ -198,9 +198,9 @@ void ConfigCompiler::HandleFileInclude(const String& include, bool search, std::vector items; - if (!Utility::Glob(includePath, boost::bind(&ConfigCompiler::CompileFile, _1))) { + if (!Utility::Glob(includePath, boost::bind(&ConfigCompiler::CompileFile, _1)) && includePath.FindFirstOf("*?") == String::NPos) { std::ostringstream msgbuf; - msgbuf << "Include file '" + include + "' does not exist (or no files found for pattern): " << debuginfo; + msgbuf << "Include file '" + include + "' does not exist: " << debuginfo; BOOST_THROW_EXCEPTION(std::invalid_argument(msgbuf.str())); } }