From c927c74c2d6fb0aabb95e552af8ca5ec1e749cd1 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Tue, 10 Nov 2009 00:30:09 -0500 Subject: Throw an exception if an include file doesn't exist --- src/textual.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/textual.cc b/src/textual.cc index 37c38e55..badbdee5 100644 --- a/src/textual.cc +++ b/src/textual.cc @@ -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, -- cgit v1.2.3