summaryrefslogtreecommitdiff
path: root/indra/newview/scripts/lua/LLDebugSettings.lua
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/scripts/lua/LLDebugSettings.lua')
-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