aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Lewycky <nlewycky@google.com>2016-06-22 13:57:25 -0700
committerNick Lewycky <nlewycky@google.com>2016-06-22 14:19:11 -0700
commit067e9f19e2e129fe377b9519bb6d574f3ecd56d5 (patch)
tree38ab2991f021860f33ffde2f879ddabf4d58b5dc
parent52fe6fcb7e0143e48b8f82f92283dea89e5c3741 (diff)
Turn CHECK failure that depends on file system state into an error message
and include what failed in the error.
-rw-r--r--eval.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/eval.cc b/eval.cc
index 3e885bb..5a3da1b 100644
--- a/eval.cc
+++ b/eval.cc
@@ -230,7 +230,9 @@ void Evaluator::EvalIf(const IfStmt* stmt) {
void Evaluator::DoInclude(const string& fname) {
Makefile* mk = MakefileCacheManager::Get()->ReadMakefile(fname);
- CHECK(mk->Exists());
+ if (!mk->Exists()) {
+ Error(StringPrintf("%s does not exist", fname.c_str()));
+ }
Var* var_list = LookupVar(Intern("MAKEFILE_LIST"));
var_list->AppendVar(this, NewLiteral(Intern(TrimLeadingCurdir(fname)).str()));