1
0
mirror of https://github.com/Icinga/icinga2.git synced 2025-04-08 17:05:25 +02:00

Check whether file was successfully opened.

This commit is contained in:
Gunnar Beutner 2012-07-02 11:04:20 +02:00
parent 7d5ab3d890
commit 9b1de189be

@ -70,6 +70,9 @@ vector<ConfigItem::Ptr> ConfigCompiler::CompileFile(const string& filename)
stream.exceptions(ifstream::badbit);
stream.open(filename.c_str(), ifstream::in);
if (!stream.good())
throw invalid_argument("Could not open config file: " + filename);
Application::Log(LogInformation, "dyn", "Compiling config file: " + filename);
return CompileStream(&stream);