activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r827751 - in /activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms: CMSException.cpp CMSException.h
Date Tue, 20 Oct 2009 18:04:24 GMT
Author: tabish
Date: Tue Oct 20 18:04:24 2009
New Revision: 827751

URL: http://svn.apache.org/viewvc?rev=827751&view=rev
Log:
fix for https://issues.apache.org/activemq/browse/AMQCPP-264

Modified:
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/CMSException.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/CMSException.h

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/CMSException.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/CMSException.cpp?rev=827751&r1=827750&r2=827751&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/CMSException.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/CMSException.cpp Tue Oct 20 18:04:24
2009
@@ -27,26 +27,26 @@
 
 namespace cms{
 
-	class CMSExceptionData {
-	public:
+    class CMSExceptionData {
+    public:
 
-		std::string message;
-		std::auto_ptr<const std::exception> cause;
-		std::vector< std::pair< std::string, int> > stackTrace;
+        std::string message;
+        std::auto_ptr<const std::exception> cause;
+        std::vector< std::pair< std::string, int> > stackTrace;
 
-	};
+    };
 
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 CMSException::CMSException() throw() : std::exception() {
-	this->data = new CMSExceptionData();
+    this->data = new CMSExceptionData();
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 CMSException::CMSException( const CMSException& ex ) throw() : std::exception() {
 
-	this->data = new CMSExceptionData();
+    this->data = new CMSExceptionData();
     this->data->cause.reset( ex.data->cause.release() );
     this->data->message = ex.data->message;
     this->data->stackTrace = ex.data->stackTrace;
@@ -75,7 +75,7 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 CMSException::~CMSException() throw() {
-	delete this->data;
+    delete this->data;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -131,3 +131,8 @@
 std::vector< std::pair< std::string, int> > CMSException::getStackTrace() const
{
     return this->data->stackTrace;
 }
+
+////////////////////////////////////////////////////////////////////////////////
+const char* CMSException::what() const throw() {
+   return this->data->message.c_str();
+}

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/CMSException.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/CMSException.h?rev=827751&r1=827750&r2=827751&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/CMSException.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/CMSException.h Tue Oct 20 18:04:24
2009
@@ -120,6 +120,13 @@
          */
         virtual std::string getStackTraceString() const;
 
+        /**
+         * Overloads the std::exception what() function to return the cause of the exception
+         *
+         * @return const char pointer to error message
+         */
+        virtual const char* what() const throw();
+
     };
 
 }



Mime
View raw message