Author: kpvdr
Date: 2007-11-20 15:03:47 -0500 (Tue, 20 Nov 2007)
New Revision: 1341
Modified:
store/trunk/cpp/lib/BdbMessageStore.cpp
Log:
Tidied up the exception messages translated from jexception into StoreException
Modified: store/trunk/cpp/lib/BdbMessageStore.cpp
===================================================================
--- store/trunk/cpp/lib/BdbMessageStore.cpp 2007-11-20 18:44:46 UTC (rev 1340)
+++ store/trunk/cpp/lib/BdbMessageStore.cpp 2007-11-20 20:03:47 UTC (rev 1341)
@@ -190,7 +190,7 @@
journal::jdir::delete_dir(getJrnlBaseDir(),true);
}
catch ( journal::jexception& e) {
- THROW_STORE_EXCEPTION(std::string("Truncate clean up failed: ") +
e.what() );
+ THROW_STORE_EXCEPTION(std::string("truncate() failed: ") + e.what() );
}
}
@@ -207,7 +207,7 @@
// init will create the deque's for the init...
jQueue->initialize();
} catch (journal::jexception& e) {
- THROW_STORE_EXCEPTION(e.what() + queue.getName());
+ THROW_STORE_EXCEPTION(std::string("Queue ") + queue.getName() +
": create() failed: " + e.what());
}
}
@@ -388,7 +388,7 @@
recoverMessages(txn, registry, queue, prepared, messages);
jQueue->recover_complete(); // start journal.
} catch (const journal::jexception& e) {
- THROW_STORE_EXCEPTION(std::string(e.what()) + queueName);
+ THROW_STORE_EXCEPTION(std::string("Queue ") + queueName +
": recoverQueues() failed: " + e.what());
}
//read all messages: done on a per queue basis if using Journal
}
@@ -546,12 +546,10 @@
} // switch
} // while
} catch (rhm::journal::jexception& e) {
- std::stringstream ss;
- ss << e;
- THROW_STORE_EXCEPTION("Error dequeuing message: " + ss.str());
+ THROW_STORE_EXCEPTION(std::string("Queue ") + queue->getName() +
+ ": recoverMessages() failed: " + e.what());
}
messageIdSequence.reset(maxMessageId + 1);
-
}
RecoverableMessage::shared_ptr
BdbMessageStore::getExternMessage(qpid::broker::RecoveryManager& recovery,
@@ -841,7 +839,8 @@
} catch (DbException& e) {
THROW_STORE_EXCEPTION_2("Error loading content", e);
} catch (journal::jexception& e) {
- THROW_STORE_EXCEPTION("Error loading content" /*, e*/);
+ THROW_STORE_EXCEPTION(std::string("Queue ") + queue.getName() +
+ ": loadContent() failed: " + e.what());
}
} else {
THROW_STORE_EXCEPTION("Cannot load content. Message not known to
store!");
@@ -858,7 +857,7 @@
jc->flush();
}
}catch ( journal::jexception& e) {
- THROW_STORE_EXCEPTION(std::string("Flush failed: ") + e.what() );
+ THROW_STORE_EXCEPTION(std::string("Queue ") + queue.getName() + ":
flush() failed: " + e.what() );
}
}
@@ -988,8 +987,8 @@
}
}
}catch ( journal::jexception& e) {
-// std::cout << "-------------" << e << std::endl;
- THROW_STORE_EXCEPTION(std::string("Enqueue failed: ") + e.what() );
+ THROW_STORE_EXCEPTION(std::string("Queue ") + queue->getName() +
": store() failed: " +
+ e.what());
}catch (DbException& e) {
THROW_STORE_EXCEPTION_2("Error storing message", e);
}
@@ -1085,7 +1084,7 @@
dres = jc->dequeue_txn_data_record(ddtokp.get(), tid);
}
} catch (rhm::journal::jexception& e) {
- THROW_STORE_EXCEPTION(std::string("Error dequeuing message") + e.what());
+ THROW_STORE_EXCEPTION(std::string("Queue ") + queue.getName() + ":
async_dequeue() failed: " + e.what());
}
switch (dres)
{
Show replies by date