From c57d16eb414345bf62545686efaf4a4ff91ba686 Mon Sep 17 00:00:00 2001 From: Bill Hoffman Date: Mon, 4 Jun 2001 18:23:58 -0400 Subject: [PATCH] ENH: add better error checking --- Source/cmSetCommand.cxx | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Source/cmSetCommand.cxx b/Source/cmSetCommand.cxx index 576cae9bb8..54242ce46a 100644 --- a/Source/cmSetCommand.cxx +++ b/Source/cmSetCommand.cxx @@ -84,6 +84,21 @@ bool cmSetCommand::Invoke(std::vector& args) value = args[1]; cacheStart = 2; } + else + { + std::string message; + message += "Syntax error in SET:\n"; + message += "CACHE requires TYPE and document string SET command:\n"; + message += "SET ("; + for(std::vector::iterator i = args.begin(); + i != args.end(); ++i) + { + message += *i; + } + message += ")\n"; + this->SetError(message.c_str()); + return false; + } if(cache) { if(args[cacheStart] != "CACHE")