summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2011-08-23 10:32:25 +0000
committerGordon Sim <gsim@apache.org>2011-08-23 10:32:25 +0000
commit187ffeb79466264c374d1f54307e67401839271a (patch)
tree7ee804471f3ed9f56711c7f4e046284525ee7ce1 /cpp
parent94d664ca0e70489a38d6791b2768babc10f222e5 (diff)
downloadqpid-python-187ffeb79466264c374d1f54307e67401839271a.tar.gz
QPID-3363, QPID-3443: Corrected exception used for 'default access' rule violations to match that specified for 'exchange-name-required'
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1160607 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp')
-rw-r--r--cpp/src/qpid/broker/Broker.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/cpp/src/qpid/broker/Broker.cpp b/cpp/src/qpid/broker/Broker.cpp
index e02a013cd1..240b9063f8 100644
--- a/cpp/src/qpid/broker/Broker.cpp
+++ b/cpp/src/qpid/broker/Broker.cpp
@@ -889,6 +889,9 @@ void Broker::deleteExchange(const std::string& name, const std::string& userId,
throw framing::UnauthorizedAccessException(QPID_MSG("ACL denied exchange delete request from " << userId));
}
+ if (name.empty()) {
+ throw framing::InvalidArgumentException(QPID_MSG("Delete not allowed for default exchange"));
+ }
Exchange::shared_ptr exchange(exchanges.get(name));
if (!exchange) throw framing::NotFoundException(QPID_MSG("Delete failed. No such exchange: " << name));
if (exchange->inUseAsAlternate()) throw framing::NotAllowedException(QPID_MSG("Exchange in use as alternate-exchange."));
@@ -917,7 +920,7 @@ void Broker::bind(const std::string& queueName,
throw framing::UnauthorizedAccessException(QPID_MSG("ACL denied exchange bind request from " << userId));
}
if (exchangeName.empty()) {
- throw framing::NotAllowedException(QPID_MSG("Bind not allowed for default exchange"));
+ throw framing::InvalidArgumentException(QPID_MSG("Bind not allowed for default exchange"));
}
Queue::shared_ptr queue = queues.find(queueName);
@@ -950,7 +953,7 @@ void Broker::unbind(const std::string& queueName,
throw framing::UnauthorizedAccessException(QPID_MSG("ACL denied exchange unbind request from " << userId));
}
if (exchangeName.empty()) {
- throw framing::NotAllowedException(QPID_MSG("Unbind not allowed for default exchange"));
+ throw framing::InvalidArgumentException(QPID_MSG("Unbind not allowed for default exchange"));
}
Queue::shared_ptr queue = queues.find(queueName);
Exchange::shared_ptr exchange = exchanges.get(exchangeName);