From e70a7bb7fbed5533690fa0fcea1e157867b2b1fa Mon Sep 17 00:00:00 2001 From: "Stephen D. Huston" Date: Wed, 28 Oct 2009 23:47:03 +0000 Subject: Change StorageProvider::Exception to inherit from qpid::Exception instead of std::exception; allows the broker to catch them and do something other than die without a message. Fixed exception handling around more ADO ops and correctly handle com exceptions without associated ErrorInfo. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@830797 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/store/ms-sql/Exception.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'cpp/src/qpid/store/ms-sql/Exception.h') diff --git a/cpp/src/qpid/store/ms-sql/Exception.h b/cpp/src/qpid/store/ms-sql/Exception.h index 34e401b068..84b7f62739 100644 --- a/cpp/src/qpid/store/ms-sql/Exception.h +++ b/cpp/src/qpid/store/ms-sql/Exception.h @@ -46,8 +46,15 @@ public: ADOException(const std::string& _text, _com_error &e) : Exception(_text) { text += ": "; - _bstr_t wmsg = e.Description(); - text += (const char *)wmsg; + IErrorInfo *i = e.ErrorInfo(); + if (i != 0) { + _bstr_t wmsg = e.Description(); + text += (const char *)wmsg; + i->Release(); + } + else { + text += e.ErrorMessage(); + } } }; -- cgit v1.2.1