diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2020-12-14 10:13:10 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2020-12-14 10:13:10 +0800 |
commit | 035f4393ab98b0de30650af94375d9c5e2fe07c1 (patch) | |
tree | 053c36dcf75ddbbfe48b221988e23774ac3bbd49 /script/proto | |
parent | 585306c685fd7801103902da734da87dfbfc5f34 (diff) | |
download | lua-language-server-035f4393ab98b0de30650af94375d9c5e2fe07c1.zip |
close function
Diffstat (limited to 'script/proto')
-rw-r--r-- | script/proto/proto.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/script/proto/proto.lua b/script/proto/proto.lua index a0758ac3..944268c2 100644 --- a/script/proto/proto.lua +++ b/script/proto/proto.lua @@ -106,7 +106,7 @@ function m.doMethod(proto) local ok = true local res -- 任务可能在执行过程中被中断,通过close来捕获 - local response <close> = util.defer(function () + local response <close> = function () local passed = os.clock() - clock if passed > 0.2 then log.debug(('Method [%s] takes [%.3f]sec.'):format(method, passed)) @@ -120,7 +120,7 @@ function m.doMethod(proto) else m.responseErr(proto.id, define.ErrorCodes.InternalError, res) end - end) + end ok, res = xpcall(abil, log.error, proto.params) end) end |