summaryrefslogtreecommitdiff
path: root/script/service.lua
diff options
context:
space:
mode:
Diffstat (limited to 'script/service.lua')
-rw-r--r--script/service.lua11
1 files changed, 4 insertions, 7 deletions
diff --git a/script/service.lua b/script/service.lua
index b5db8080..69343f3f 100644
--- a/script/service.lua
+++ b/script/service.lua
@@ -92,13 +92,10 @@ function mt:_callMethod(name, params)
end
function mt:responseProto(id, response, err)
- local container = table.container()
- if err then
- container.error = err
- else
- container.result = response
- end
- rpc:response(id, container)
+ rpc:response(id, {
+ error = err and err or nil,
+ result = response and response or json.null,
+ })
end
function mt:_doProto(proto)