diff options
author | Ted Ross <tross@apache.org> | 2010-06-11 21:46:57 +0000 |
---|---|---|
committer | Ted Ross <tross@apache.org> | 2010-06-11 21:46:57 +0000 |
commit | fa7068d1cb629de8cea4aa2743c9bc3f7d563a0f (patch) | |
tree | 497c2d9b8001513a33f8056c5afa7fdf6974a4d9 /cpp | |
parent | 5979d7fdacaf03f7d3b4b03f627960280f9c2b34 (diff) | |
download | qpid-python-fa7068d1cb629de8cea4aa2743c9bc3f7d563a0f.tar.gz |
Fixed a bug in which QMF error return codes were being sent back as 7 - Exception.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@953885 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp')
-rw-r--r-- | cpp/src/qpid/agent/ManagementAgentImpl.cpp | 32 |
1 files changed, 12 insertions, 20 deletions
diff --git a/cpp/src/qpid/agent/ManagementAgentImpl.cpp b/cpp/src/qpid/agent/ManagementAgentImpl.cpp index 6a07d8c0e7..e2a595cd85 100644 --- a/cpp/src/qpid/agent/ManagementAgentImpl.cpp +++ b/cpp/src/qpid/agent/ManagementAgentImpl.cpp @@ -499,8 +499,8 @@ void ManagementAgentImpl::invokeMethodRequest(const string& body, const string& if ((oid = inMap.find("_object_id")) == inMap.end() || (mid = inMap.find("_method_name")) == inMap.end()) { - (outMap["_values"].asMap())["_status_code"] = Manageable::STATUS_PARAMETER_INVALID; - (outMap["_values"].asMap())["_status_text"] = Manageable::StatusText(Manageable::STATUS_PARAMETER_INVALID); + sendException(replyTo, cid, Manageable::StatusText(Manageable::STATUS_PARAMETER_INVALID), + Manageable::STATUS_PARAMETER_INVALID); failed = true; } else { string methodName; @@ -520,8 +520,8 @@ void ManagementAgentImpl::invokeMethodRequest(const string& body, const string& ManagementObjectMap::iterator iter = managementObjects.find(objId); if (iter == managementObjects.end() || iter->second->isDeleted()) { - (outMap["_values"].asMap())["_status_code"] = Manageable::STATUS_UNKNOWN_OBJECT; - (outMap["_values"].asMap())["_status_text"] = Manageable::StatusText(Manageable::STATUS_UNKNOWN_OBJECT); + sendException(replyTo, cid, Manageable::StatusText(Manageable::STATUS_UNKNOWN_OBJECT), + Manageable::STATUS_UNKNOWN_OBJECT); failed = true; } else { iter->second->doMethod(methodName, inArgs, callMap); @@ -534,33 +534,25 @@ void ManagementAgentImpl::invokeMethodRequest(const string& body, const string& if (iter->first != "_status_code" && iter->first != "_status_text") outMap["_arguments"].asMap()[iter->first] = iter->second; } else { - (outMap["_values"].asMap())["_status_code"] = callMap["_status_code"]; - (outMap["_values"].asMap())["_status_text"] = callMap["_status_text"]; + sendException(replyTo, cid, callMap["_status_text"], callMap["_status_code"]); failed = true; } } catch(types::InvalidConversion& e) { - outMap.clear(); - outMap["_values"] = Variant::Map(); - (outMap["_values"].asMap())["_status_code"] = Manageable::STATUS_EXCEPTION; - (outMap["_values"].asMap())["_status_text"] = e.what(); + sendException(replyTo, cid, e.what(), Manageable::STATUS_EXCEPTION); failed = true; } } - Variant::Map headers; - headers["method"] = "response"; - headers["qmf.agent"] = name_address; - if (failed) { - headers["qmf.opcode"] = "_exception"; - QPID_LOG(trace, "SENT Exception map=" << outMap); - } else { + if (!failed) { + Variant::Map headers; + headers["method"] = "response"; + headers["qmf.agent"] = name_address; headers["qmf.opcode"] = "_method_response"; QPID_LOG(trace, "SENT MethodResponse map=" << outMap); + MapCodec::encode(outMap, content); + connThreadBody.sendBuffer(content, cid, headers, "qmf.default.direct", replyTo); } - - MapCodec::encode(outMap, content); - connThreadBody.sendBuffer(content, cid, headers, "qmf.default.direct", replyTo); } void ManagementAgentImpl::handleGetQuery(const string& body, const string& cid, const string& replyTo) |