summaryrefslogtreecommitdiff
path: root/qpid/cpp/src
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2007-12-10 21:03:07 +0000
committerAlan Conway <aconway@apache.org>2007-12-10 21:03:07 +0000
commitef366f198088c23587b41765e445d35dee0ce246 (patch)
tree500494fb98ecfce4b6c5211fe35e6b158899ae09 /qpid/cpp/src
parent0cbf88f24f15ea6d92256d949526faaf9af8dc31 (diff)
downloadqpid-python-ef366f198088c23587b41765e445d35dee0ce246.tar.gz
Improved exception message for messages out-of-order.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@603047 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src')
-rw-r--r--qpid/cpp/src/tests/perftest.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/qpid/cpp/src/tests/perftest.cpp b/qpid/cpp/src/tests/perftest.cpp
index d6185a0100..bf6b0fe4d5 100644
--- a/qpid/cpp/src/tests/perftest.cpp
+++ b/qpid/cpp/src/tests/perftest.cpp
@@ -231,9 +231,13 @@ class Stats {
// Functor to collect rates.
void operator()(const string& data) {
- double d=lexical_cast<double>(data);
- values.push_back(d);
- sum += d;
+ try {
+ double d=lexical_cast<double>(data);
+ values.push_back(d);
+ sum += d;
+ } catch (const std::exception&) {
+ throw Exception("Bad report: "+data);
+ }
}
double mean() const {
@@ -423,7 +427,7 @@ struct SubscribeThread : public Client {
size_t lastMsg=0;
for (size_t i = 0; i < opts.subQuota; ++i) {
msg=lq.pop();
- // TODO aconway 2007-11-23: check message sequence for
+ // TODO aconway 2007-11-23: check message order for.
// multiple publishers. Need an array of counters,
// one per publisher and a publisher ID in the
// message. Careful not to introduce a lot of overhead
@@ -435,7 +439,10 @@ struct SubscribeThread : public Client {
size_t n = *reinterpret_cast<uint32_t*>(data);
if (n < lastMsg) {
// Report to control.
- Message error("Out-of-sequence messages", "sub_done");
+ Message error(
+ QPID_MSG("Out-of-sequence messages, expected n>="
+ << lastMsg << " got " << n),
+ "sub_done");
session.messageTransfer(arg::content=error);
return;
}