diff options
| author | Gordon Sim <gsim@apache.org> | 2008-06-03 12:39:14 +0000 |
|---|---|---|
| committer | Gordon Sim <gsim@apache.org> | 2008-06-03 12:39:14 +0000 |
| commit | 0ab3a58ce116a5a2c68627b9456060b3a1abd2ec (patch) | |
| tree | 02fbcab16e0a5ef66460872a97de17ab4cd61587 /qpid/cpp/src | |
| parent | ea9bd9848638d827b3d02d7d3fd6a2bf32f35a4b (diff) | |
| download | qpid-python-0ab3a58ce116a5a2c68627b9456060b3a1abd2ec.tar.gz | |
Better exception handling for commit.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@662774 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src')
| -rw-r--r-- | qpid/cpp/src/qpid/broker/SemanticState.cpp | 2 | ||||
| -rw-r--r-- | qpid/cpp/src/qpid/broker/TxPublish.cpp | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/qpid/cpp/src/qpid/broker/SemanticState.cpp b/qpid/cpp/src/qpid/broker/SemanticState.cpp index 3c4f6abc30..b3167d0377 100644 --- a/qpid/cpp/src/qpid/broker/SemanticState.cpp +++ b/qpid/cpp/src/qpid/broker/SemanticState.cpp @@ -127,6 +127,8 @@ void SemanticState::commit(MessageStore* const store, bool completeOnCommit) txBuffer->enlist(txAck); if (txBuffer->commitLocal(store)) { accumulatedAck.clear(); + } else { + throw InternalErrorException(QPID_MSG("Commit failed")); } } diff --git a/qpid/cpp/src/qpid/broker/TxPublish.cpp b/qpid/cpp/src/qpid/broker/TxPublish.cpp index 1a8630eb54..dcee00e803 100644 --- a/qpid/cpp/src/qpid/broker/TxPublish.cpp +++ b/qpid/cpp/src/qpid/broker/TxPublish.cpp @@ -30,10 +30,12 @@ bool TxPublish::prepare(TransactionContext* ctxt) throw(){ try{ for_each(queues.begin(), queues.end(), Prepare(ctxt, msg)); return true; + }catch(const std::exception& e){ + QPID_LOG(error, "Failed to prepare: " << e.what()); }catch(...){ - QPID_LOG(error, "Failed to prepare"); - return false; + QPID_LOG(error, "Failed to prepare (unknown error)"); } + return false; } void TxPublish::commit() throw(){ |
