summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2008-06-03 12:39:14 +0000
committerGordon Sim <gsim@apache.org>2008-06-03 12:39:14 +0000
commitf2070c82265f6655bc989cb6326db56eb545235d (patch)
tree264488601d4fa0b05f41f40010c8ffb6cd5bbc0e /cpp
parenta4db569ee1ee2a8c8c24131649e6a24a222b0c1a (diff)
downloadqpid-python-f2070c82265f6655bc989cb6326db56eb545235d.tar.gz
Better exception handling for commit.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@662774 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp')
-rw-r--r--cpp/src/qpid/broker/SemanticState.cpp2
-rw-r--r--cpp/src/qpid/broker/TxPublish.cpp6
2 files changed, 6 insertions, 2 deletions
diff --git a/cpp/src/qpid/broker/SemanticState.cpp b/cpp/src/qpid/broker/SemanticState.cpp
index 3c4f6abc30..b3167d0377 100644
--- a/cpp/src/qpid/broker/SemanticState.cpp
+++ b/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/cpp/src/qpid/broker/TxPublish.cpp b/cpp/src/qpid/broker/TxPublish.cpp
index 1a8630eb54..dcee00e803 100644
--- a/cpp/src/qpid/broker/TxPublish.cpp
+++ b/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(){