From fb0296656d4d332b95e50982335231d1b49da3f7 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 13 Mar 2008 14:13:44 -0400 Subject: [PATCH] ENH: Improve error message when invalid policy is given. --- Source/cmMakefile.cxx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 4819c6330..d8989bdc5 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -3332,11 +3332,12 @@ bool cmMakefile::SetPolicy(const char *id, { cmPolicies::PolicyID pid; if (!this->GetPolicies()->GetPolicyID(id, /* out */ pid)) - { - cmSystemTools::Error("Invalid policy string used. Invalid string was " - , id); + { + cmOStringStream e; + e << "Policy \"" << id << "\" is not known to this version of CMake."; + this->IssueMessage(cmake::FATAL_ERROR, e.str()); return false; - } + } return this->SetPolicy(pid,status); }