summaryrefslogtreecommitdiffstats
path: root/Source/cmCommand.h
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2001-03-12 23:30:58 (GMT)
committerBrad King <brad.king@kitware.com>2001-03-12 23:30:58 (GMT)
commitce484264de3ae08a5cca9b6c3f75d1a1f914b4a4 (patch)
tree5c686a8b3b6a065cc6b2a2bd58336e204af94b7b /Source/cmCommand.h
parent8c4795025fd28088507e5814e167bdfc9f0345f0 (diff)
downloadCMake-ce484264de3ae08a5cca9b6c3f75d1a1f914b4a4.zip
CMake-ce484264de3ae08a5cca9b6c3f75d1a1f914b4a4.tar.gz
CMake-ce484264de3ae08a5cca9b6c3f75d1a1f914b4a4.tar.bz2
ENH: Improved error handling when GetError is called on a command that has not called SetError.
Diffstat (limited to 'Source/cmCommand.h')
-rw-r--r--Source/cmCommand.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/Source/cmCommand.h b/Source/cmCommand.h
index 55841c4..ebfd609 100644
--- a/Source/cmCommand.h
+++ b/Source/cmCommand.h
@@ -120,7 +120,14 @@ public:
* Return the last error string.
*/
const char* GetError()
- {return m_Error.c_str();}
+ {
+ if(m_Error.length() == 0)
+ {
+ std::string m_Error = this->GetName();
+ m_Error += " uknown error.";
+ }
+ return m_Error.c_str();
+ }
/**
* Returns true if this class is the given class, or a subclass of it.