summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--project2/sql/mockDatabase.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/project2/sql/mockDatabase.cpp b/project2/sql/mockDatabase.cpp
index b357abd..a9f812d 100644
--- a/project2/sql/mockDatabase.cpp
+++ b/project2/sql/mockDatabase.cpp
@@ -49,6 +49,9 @@ MockDatabase::PlaySchemaScript(DB::Connection * conn, const boost::filesystem::p
Logger()->messagebf(LOG_DEBUG, "%s << %s", mockName, s);
std::ifstream f;
f.open(s.string());
+ if (!f.good()) {
+ throw std::runtime_error("Failed to open mock script: " + s.string());
+ }
auto lexer = boost::shared_ptr<FlexLexer>(new sqlFlexLexer(s.parent_path(), f, conn));
while(lexer->yylex() != 0) ;
f.close();