summaryrefslogtreecommitdiff
path: root/qpid/cpp/src
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2010-01-06 17:01:12 +0000
committerAlan Conway <aconway@apache.org>2010-01-06 17:01:12 +0000
commitd7530cec59b22c2c8bf3b7f2096c3bac4de992a3 (patch)
tree1a6d029c90477f72b40f9aafaaecc0a74295766f /qpid/cpp/src
parent828c153afcdc15766cf71945cdf5f98f471a08aa (diff)
downloadqpid-python-d7530cec59b22c2c8bf3b7f2096c3bac4de992a3.tar.gz
Exception handling for URL parsing in cluster.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@896537 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src')
-rw-r--r--qpid/cpp/src/qpid/cluster/Cluster.cpp14
-rw-r--r--qpid/cpp/src/qpid/cluster/ClusterMap.cpp10
2 files changed, 16 insertions, 8 deletions
diff --git a/qpid/cpp/src/qpid/cluster/Cluster.cpp b/qpid/cpp/src/qpid/cluster/Cluster.cpp
index 738a9fc5c4..cdeb89188b 100644
--- a/qpid/cpp/src/qpid/cluster/Cluster.cpp
+++ b/qpid/cpp/src/qpid/cluster/Cluster.cpp
@@ -687,11 +687,15 @@ void Cluster::initialStatus(const MemberId& member, uint32_t version, bool activ
}
void Cluster::ready(const MemberId& id, const std::string& url, Lock& l) {
- if (map.ready(id, Url(url)))
- memberUpdate(l);
- if (state == CATCHUP && id == self) {
- setReady(l);
- QPID_LOG(notice, *this << " caught up.");
+ try {
+ if (map.ready(id, Url(url)))
+ memberUpdate(l);
+ if (state == CATCHUP && id == self) {
+ setReady(l);
+ QPID_LOG(notice, *this << " caught up.");
+ }
+ } catch (const Url::Invalid& e) {
+ QPID_LOG(error, "Invalid URL in cluster ready command: " << url);
}
}
diff --git a/qpid/cpp/src/qpid/cluster/ClusterMap.cpp b/qpid/cpp/src/qpid/cluster/ClusterMap.cpp
index 8cac470ef3..85ed447113 100644
--- a/qpid/cpp/src/qpid/cluster/ClusterMap.cpp
+++ b/qpid/cpp/src/qpid/cluster/ClusterMap.cpp
@@ -137,9 +137,13 @@ ostream& operator<<(ostream& o, const ClusterMap& m) {
}
bool ClusterMap::updateRequest(const MemberId& id, const string& url) {
- if (isAlive(id)) {
- joiners[id] = Url(url);
- return true;
+ try {
+ if (isAlive(id)) {
+ joiners[id] = Url(url);
+ return true;
+ }
+ } catch (const Url::Invalid&) {
+ QPID_LOG(error, "Invalid URL in cluster update request: " << url);
}
return false;
}