Skip to content

Commit

Permalink
--check: Attempt to write output even if an error occurs
Browse files Browse the repository at this point in the history
This enables writing partial output if you press ctrl-c after seeing
the first errors show up.
  • Loading branch information
emmericp committed Apr 20, 2024
1 parent 748eab1 commit 909cd37
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions script/cli/check.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local lclient = require 'lclient'
local lclient = require 'lclient'()
local furi = require 'file-uri'
local ws = require 'workspace'
local files = require 'files'
Expand Down Expand Up @@ -41,8 +41,14 @@ util.enableCloseFunction()

local lastClock = os.clock()
local results = {}

local function errorhandler(err)
print(err)
print(debug.traceback())
end

---@async
lclient():start(function (client)
xpcall(lclient.start, errorhandler, lclient, function (client)
client:registerFakers()

client:initialize {
Expand Down

0 comments on commit 909cd37

Please sign in to comment.