Throw an exception if an include file doesn't exist

This commit is contained in:
John Wiegley 2009-11-10 00:30:09 -05:00
parent 687c71c71d
commit c927c74c2d

View file

@ -613,6 +613,10 @@ void instance_t::include_directive(char * line)
DEBUG("textual.include", "Line " << linenum << ": " <<
"Including path '" << filename << "'");
if (! exists(filename))
throw_(std::runtime_error,
_("File to include was not found: '%1'" << filename));
ifstream stream(filename);
instance_t instance(account_stack, tag_stack,