diff options
author | Richard Linden <none@none> | 2011-10-15 18:14:49 -0700 |
---|---|---|
committer | Richard Linden <none@none> | 2011-10-15 18:14:49 -0700 |
commit | 4aed73ceb18c656e0f36c91bd0efb9a705341629 (patch) | |
tree | 013b1382be366aa2a9d1caf7bb563e04f7d8b2ed /indra/llcommon/lleventapi.cpp | |
parent | 7c2f2b526ad2b33f1e25378b5a05379de6aa0b5a (diff) | |
parent | 62d9db2f21b2a6fb579e8f7631a4e387cc5e5b29 (diff) |
Automated merge with ssh://hg.lindenlab.com/richard/viewer-experience-fui
Diffstat (limited to 'indra/llcommon/lleventapi.cpp')
-rw-r--r-- | indra/llcommon/lleventapi.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/indra/llcommon/lleventapi.cpp b/indra/llcommon/lleventapi.cpp index 4270c8b511..ff5459c1eb 100644 --- a/indra/llcommon/lleventapi.cpp +++ b/indra/llcommon/lleventapi.cpp @@ -34,6 +34,7 @@ // std headers // external library headers // other Linden headers +#include "llerror.h" LLEventAPI::LLEventAPI(const std::string& name, const std::string& desc, const std::string& field): lbase(name, field), @@ -45,3 +46,32 @@ LLEventAPI::LLEventAPI(const std::string& name, const std::string& desc, const s LLEventAPI::~LLEventAPI() { } + +LLEventAPI::Response::Response(const LLSD& seed, const LLSD& request, const LLSD::String& replyKey): + mResp(seed), + mReq(request), + mKey(replyKey) +{} + +LLEventAPI::Response::~Response() +{ + // When you instantiate a stack Response object, if the original + // request requested a reply, send it when we leave this block, no + // matter how. + sendReply(mResp, mReq, mKey); +} + +void LLEventAPI::Response::warn(const std::string& warning) +{ + LL_WARNS("LLEventAPI::Response") << warning << LL_ENDL; + mResp["warnings"].append(warning); +} + +void LLEventAPI::Response::error(const std::string& error) +{ + // Use LL_WARNS rather than LL_ERROR: we don't want the viewer to shut + // down altogether. + LL_WARNS("LLEventAPI::Response") << error << LL_ENDL; + + mResp["error"] = error; +} |