summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md1
-rw-r--r--server/src/service.lua9
2 files changed, 6 insertions, 4 deletions
diff --git a/README.md b/README.md
index 39c868b2..86d0c671 100644
--- a/README.md
+++ b/README.md
@@ -17,6 +17,7 @@
- [ ] Support Dirty Script
- [ ] Syntax Check
- [ ] Multi Workspace
+- [ ] Type Format
### Locale
diff --git a/server/src/service.lua b/server/src/service.lua
index 3d530e4d..ac986bf7 100644
--- a/server/src/service.lua
+++ b/server/src/service.lua
@@ -36,7 +36,7 @@ function mt:_callMethod(name, params)
local f = method[name]
if f then
local clock = os.clock()
- local suc, res = xpcall(f, log.error, self, params)
+ local suc, res = xpcall(f, debug.traceback, self, params)
local passed = os.clock() - clock
if passed > 0.1 then
log.debug(('Task [%s] takes [%.3f]sec.'):format(name, passed))
@@ -44,14 +44,15 @@ function mt:_callMethod(name, params)
if suc then
return res
else
- local suc, res = pcall(table.dump, params)
- local dump = suc and res or 'Cyclic table'
+ local ok, r = pcall(table.dump, params)
+ local dump = ok and r or 'Cyclic table'
log.debug(('Task [%s] failed, params: %s'):format(
name, dump
))
+ log.debug(res)
return nil, {
code = ErrorCodes.InternalError,
- message = res,
+ message = r .. '\n' .. res,
}
end
end