mirror of https://github.com/Icinga/icinga2.git
Check whether file was successfully opened.
This commit is contained in:
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);
|
||||
|
|
Loading…
Reference in New Issue