Skip to content

Commit

Permalink
fix(profiling): ensure proper traces in case of require errors
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Oct 9, 2023
1 parent 5579d72 commit 2782f81
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lua/lazy/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,13 @@ local function profile_require()
if Util and not done[modname] then
done[modname] = true
Util.track({ require = modname })
local ret = vim.F.pack_len(r(modname))
local ok, ret = pcall(function()
return vim.F.pack_len(r(modname))
end)
Util.track()
if not ok then
error(ret, 2)
end
return vim.F.unpack_len(ret)
else
return r(modname)
Expand Down

0 comments on commit 2782f81

Please sign in to comment.