summaryrefslogtreecommitdiff
path: root/indra/newview/scripts
diff options
context:
space:
mode:
authorMnikolenko Productengine <mnikolenko@productengine.com>2024-05-02 14:03:34 +0300
committerMnikolenko Productengine <mnikolenko@productengine.com>2024-05-02 14:03:34 +0300
commitf9a2748b542d05d153fa591a8c452162d9402828 (patch)
tree4334ec60cadf7aefddf8266c21731b38592aa583 /indra/newview/scripts
parent79dca07d790a47db192099bcb85e740676a643ee (diff)
Raise Lua error if LLViewerControlListener response contains one
Diffstat (limited to 'indra/newview/scripts')
-rw-r--r--indra/newview/scripts/lua/LLDebugSettings.lua13
1 files changed, 10 insertions, 3 deletions
diff --git a/indra/newview/scripts/lua/LLDebugSettings.lua b/indra/newview/scripts/lua/LLDebugSettings.lua
index 80ae7e87bb..c809dfff91 100644
--- a/indra/newview/scripts/lua/LLDebugSettings.lua
+++ b/indra/newview/scripts/lua/LLDebugSettings.lua
@@ -1,17 +1,24 @@
leap = require 'leap'
+function check_response(res)
+ if res.error then
+ error(res.error)
+ end
+ return res
+end
+
local LLDebugSettings = {}
function LLDebugSettings.set(name, value)
- return leap.request('LLViewerControl', {op='set', group='Global', key=name, value=value})
+ check_response(leap.request('LLViewerControl', {op='set', group='Global', key=name, value=value}))
end
function LLDebugSettings.toggle(name)
- return leap.request('LLViewerControl', {op='toggle', group='Global', key=name})
+ check_response(leap.request('LLViewerControl', {op='toggle', group='Global', key=name}))
end
function LLDebugSettings.get(name)
- return leap.request('LLViewerControl', {op='get', group='Global', key=name})['value']
+ return check_response(leap.request('LLViewerControl', {op='get', group='Global', key=name}))['value']
end
return LLDebugSettings