summaryrefslogtreecommitdiff
path: root/script-beta/jsonrpc.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2020-11-09 10:07:32 +0800
committer最萌小汐 <sumneko@hotmail.com>2020-11-09 10:07:32 +0800
commitb374e5c8db648f81d278bf452f63105b3b60f368 (patch)
tree2543152c970bdd3d824b1299c046b3836bc7990f /script-beta/jsonrpc.lua
parentc302f165c2713fa1d3258622fcf4e7eb7ec56aca (diff)
downloadlua-language-server-b374e5c8db648f81d278bf452f63105b3b60f368.zip
修正一些错误日志
Diffstat (limited to 'script-beta/jsonrpc.lua')
-rw-r--r--script-beta/jsonrpc.lua11
1 files changed, 6 insertions, 5 deletions
diff --git a/script-beta/jsonrpc.lua b/script-beta/jsonrpc.lua
index d0befd5b..39cd00f5 100644
--- a/script-beta/jsonrpc.lua
+++ b/script-beta/jsonrpc.lua
@@ -1,7 +1,8 @@
-local json = require 'json'
-local pcall = pcall
+local json = require 'json'
+local pcall = pcall
local tonumber = tonumber
-local log = require 'brave.log'
+local util = require 'utility'
+local log = require 'brave.log'
_ENV = nil
@@ -28,7 +29,7 @@ local function readProtoHead(reader, errHandle)
end
local k, v = line:match '^([^:]+)%s*%:%s*(.+)\r\n$'
if not k then
- errHandle('Proto header error:', head)
+ errHandle('Proto header error:', line)
break
end
if k == 'Content-Length' then
@@ -43,7 +44,7 @@ function m.decode(reader, errHandle)
local head = readProtoHead(reader, errHandle)
local len = head['Content-Length']
if not len then
- errHandle('Proto header error:', head)
+ errHandle('Proto header error:', util.dump(head))
return nil
end
local content = reader(len)