Return-Path: Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: (qmail 45645 invoked from network); 20 Oct 2009 18:04:49 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 20 Oct 2009 18:04:49 -0000 Received: (qmail 21172 invoked by uid 500); 20 Oct 2009 18:04:49 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 21127 invoked by uid 500); 20 Oct 2009 18:04:48 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 21118 invoked by uid 99); 20 Oct 2009 18:04:48 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 Oct 2009 18:04:48 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 Oct 2009 18:04:46 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 650E9238889C; Tue, 20 Oct 2009 18:04:25 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@activemq.apache.org From: tabish@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20091020180425.650E9238889C@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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 cause; - std::vector< std::pair< std::string, int> > stackTrace; + std::string message; + std::auto_ptr 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(); + }; }