From 53e3ea6ad5a26ed61bcfa810befc7a3a0dc1e3a0 Mon Sep 17 00:00:00 2001 From: Gordon Sim Date: Fri, 25 Feb 2011 17:30:59 +0000 Subject: QPID-2324: Raise 404 on cancellation if no such subscription exists. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1074642 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/broker/SessionAdapter.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'cpp/src/qpid/broker/SessionAdapter.cpp') diff --git a/cpp/src/qpid/broker/SessionAdapter.cpp b/cpp/src/qpid/broker/SessionAdapter.cpp index b95bb196fd..68aa26b270 100644 --- a/cpp/src/qpid/broker/SessionAdapter.cpp +++ b/cpp/src/qpid/broker/SessionAdapter.cpp @@ -431,7 +431,9 @@ SessionAdapter::MessageHandlerImpl::subscribe(const string& queueName, void SessionAdapter::MessageHandlerImpl::cancel(const string& destination ) { - state.cancel(destination); + if (!state.cancel(destination)) { + throw NotFoundException(QPID_MSG("No such subscription: " << destination)); + } ManagementAgent* agent = getBroker().getManagementAgent(); if (agent) -- cgit v1.2.1