diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2024-04-19 12:08:09 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2024-04-19 12:08:09 +0800 |
commit | a449b5f4b1752f10653c06ddaf410f6e6d7df5ef (patch) | |
tree | 0db9d2e1ba5d6f54b3f977a65057dcdc94142c74 /script | |
parent | f96930cc77e2987f756c9bb38ac25f0fdf7ef7e7 (diff) | |
download | lua-language-server-a449b5f4b1752f10653c06ddaf410f6e6d7df5ef.zip |
socket连接把错误打印到日志中
Diffstat (limited to 'script')
-rw-r--r-- | script/brave/work.lua | 8 | ||||
-rw-r--r-- | script/proto/proto.lua | 4 |
2 files changed, 12 insertions, 0 deletions
diff --git a/script/brave/work.lua b/script/brave/work.lua index cdba955e..5727ba11 100644 --- a/script/brave/work.lua +++ b/script/brave/work.lua @@ -52,11 +52,19 @@ brave.on('loadProtoBySocket', function (param) coroutine.resume(parser) end + function lsclient:on_error(...) + log.error(...) + end + function lsmaster:on_data(data) lsclient:write(data) --net.update() end + function lsmaster:on_error(...) + log.error(...) + end + while true do net.update(10) end diff --git a/script/proto/proto.lua b/script/proto/proto.lua index d9e3354d..dff7063d 100644 --- a/script/proto/proto.lua +++ b/script/proto/proto.lua @@ -268,6 +268,10 @@ function m.listen(mode, socketPort) return true end + function server:on_error(...) + log.error(...) + end + pub.task('loadProtoBySocket', { port = socketPort, unixPath = unixPath, |