summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-11-10 00:30:09 -0500
committerJohn Wiegley <johnw@newartisans.com>2009-11-10 00:30:09 -0500
commitc927c74c2d6fb0aabb95e552af8ca5ec1e749cd1 (patch)
tree9aa48cacd11f557b9b5c9c9d43a95538e5e4e4a8 /src
parent687c71c71de548002b270dadbe0242e35ba71dc7 (diff)
downloadfork-ledger-c927c74c2d6fb0aabb95e552af8ca5ec1e749cd1.tar.gz
fork-ledger-c927c74c2d6fb0aabb95e552af8ca5ec1e749cd1.tar.bz2
fork-ledger-c927c74c2d6fb0aabb95e552af8ca5ec1e749cd1.zip
Throw an exception if an include file doesn't exist
Diffstat (limited to 'src')
-rw-r--r--src/textual.cc4
1 files changed, 4 insertions, 0 deletions
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,