diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2024-05-15 09:03:02 -0400 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2024-05-15 09:03:02 -0400 |
commit | 1abf5f18d6afc7ae9e1b1562b92e5c1ce33b722f (patch) | |
tree | 0b9885834fbf5735150be4c982bd52b0c06ef3c7 /indra | |
parent | 2c687e6d687ead0f29c096271b207dbe16b31c35 (diff) |
Make leap.lua honor an "error" key in viewer response.
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/scripts/lua/leap.lua | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/indra/newview/scripts/lua/leap.lua b/indra/newview/scripts/lua/leap.lua index ade91789f0..cfb7377523 100644 --- a/indra/newview/scripts/lua/leap.lua +++ b/indra/newview/scripts/lua/leap.lua @@ -161,10 +161,12 @@ function leap.request(pump, data) dbg('leap.request(%s, %s) got %s: %s', pump, data, ok, response) -- kill off temporary WaitForReqid object, even if error pending[reqid] = nil - if ok then - return response - else + if not ok then error(response) + elseif response.error then + error(response.error) + else + return response end end @@ -186,7 +188,7 @@ function leap.generate(pump, data, checklast) local ok, response, resumed_with repeat ok, response = pcall(waitfor.wait, waitfor) - if not ok then + if (not ok) or response.error then break end -- can resume(false) to terminate generate() and clean up @@ -196,6 +198,8 @@ function leap.generate(pump, data, checklast) pending[reqid] = nil if not ok then error(response) + elseif response.error then + error(response.error) end end |