Переглянути джерело

Added a getter for the exception message.

Sascha Zelzer 13 роки тому
батько
коміт
27cc677be9
2 змінених файлів з 13 додано та 0 видалено
  1. 7 0
      Libs/Core/ctkException.cpp
  2. 6 0
      Libs/Core/ctkException.h

+ 7 - 0
Libs/Core/ctkException.cpp

@@ -106,6 +106,13 @@ const char* ctkException::what() const throw()
 }
 }
 
 
 // --------------------------------------------------------------------------
 // --------------------------------------------------------------------------
+QString ctkException::message() const throw()
+{
+  return Msg;
+}
+
+
+// --------------------------------------------------------------------------
 ctkException* ctkException::clone() const
 ctkException* ctkException::clone() const
 {
 {
   return new ctkException(*this);
   return new ctkException(*this);

+ 6 - 0
Libs/Core/ctkException.h

@@ -103,6 +103,12 @@ public:
   virtual const char* what() const throw();
   virtual const char* what() const throw();
 
 
   /**
   /**
+   * @brief Returns the detail message string of this exception.
+   * @return The detail exception message.
+   */
+  QString message() const throw();
+
+  /**
    * @brief Creates a copy of this exception. Use rethrow() to throw the
    * @brief Creates a copy of this exception. Use rethrow() to throw the
    * copy again.
    * copy again.
    * @return A copy of this exception.
    * @return A copy of this exception.