summaryrefslogtreecommitdiff
path: root/src/parser/parser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/parser/parser.cpp')
-rw-r--r--src/parser/parser.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/parser/parser.cpp b/src/parser/parser.cpp
index 84796f093..85b6c9865 100644
--- a/src/parser/parser.cpp
+++ b/src/parser/parser.cpp
@@ -124,6 +124,9 @@ Parser* Parser::getNewParser(ExprManager* em, InputLanguage lang,
Parser* Parser::getNewParser(ExprManager* em, InputLanguage lang,
string filename) {
istream* input = new ifstream(filename.c_str());
+ if(!*input) {
+ throw Exception("file does not exist or is unreadable: " + filename);
+ }
return getNewParser(em, lang, input, filename, true);
}
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback