summaryrefslogtreecommitdiff
path: root/indra/newview/scripts/lua/leap.lua
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2024-05-15 09:03:02 -0400
committerNat Goodspeed <nat@lindenlab.com>2024-05-15 09:03:02 -0400
commit1abf5f18d6afc7ae9e1b1562b92e5c1ce33b722f (patch)
tree0b9885834fbf5735150be4c982bd52b0c06ef3c7 /indra/newview/scripts/lua/leap.lua
parent2c687e6d687ead0f29c096271b207dbe16b31c35 (diff)
Make leap.lua honor an "error" key in viewer response.
Diffstat (limited to 'indra/newview/scripts/lua/leap.lua')
-rw-r--r--indra/newview/scripts/lua/leap.lua12
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