diff options
author | Gordon Sim <gsim@apache.org> | 2009-05-21 12:42:33 +0000 |
---|---|---|
committer | Gordon Sim <gsim@apache.org> | 2009-05-21 12:42:33 +0000 |
commit | 12ed230c0d4e3bf427b1ff058884ab6dd994a1b4 (patch) | |
tree | 74b2930f1627f8512f42618b5327a0a3230fa515 /cpp/src/qpid/broker/Exchange.cpp | |
parent | 8ac585d1a4cf8facf8eb1109f8e028ccde1b31f4 (diff) | |
download | qpid-python-12ed230c0d4e3bf427b1ff058884ab6dd994a1b4.tar.gz |
Handle case where recovered exchange is of unrecognised type.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@777096 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/broker/Exchange.cpp')
-rw-r--r-- | cpp/src/qpid/broker/Exchange.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/cpp/src/qpid/broker/Exchange.cpp b/cpp/src/qpid/broker/Exchange.cpp index acedd1f91a..6ce381d199 100644 --- a/cpp/src/qpid/broker/Exchange.cpp +++ b/cpp/src/qpid/broker/Exchange.cpp @@ -160,9 +160,14 @@ Exchange::shared_ptr Exchange::decode(ExchangeRegistry& exchanges, Buffer& buffe buffer.getShortString(type); buffer.get(args); - Exchange::shared_ptr exch = exchanges.declare(name, type, durable, args).first; - exch->sequenceNo = args.getAsInt64(qpidSequenceCounter); - return exch; + try { + Exchange::shared_ptr exch = exchanges.declare(name, type, durable, args).first; + exch->sequenceNo = args.getAsInt64(qpidSequenceCounter); + return exch; + } catch (const UnknownExchangeTypeException&) { + QPID_LOG(warning, "Could not create exchange " << name << "; type " << type << " is not recognised"); + return Exchange::shared_ptr(); + } } void Exchange::encode(Buffer& buffer) const |