diff options
author | Brad King <brad.king@kitware.com> | 2001-03-12 23:30:58 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2001-03-12 23:30:58 (GMT) |
commit | ce484264de3ae08a5cca9b6c3f75d1a1f914b4a4 (patch) | |
tree | 5c686a8b3b6a065cc6b2a2bd58336e204af94b7b /Source/cmCommand.h | |
parent | 8c4795025fd28088507e5814e167bdfc9f0345f0 (diff) | |
download | CMake-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.h | 9 |
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. |