Skip to content

Commit

Permalink
feat(loader): added error handler to sourcing of runtime files
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Dec 17, 2022
1 parent 53affca commit eeb06a5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lua/lazy/core/loader.lua
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,9 @@ function M.source_runtime(...)
name = name:sub(1, -5)
if t == "file" and (ext == "lua" or ext == "vim") and not M.disabled_rtp_plugins[name] then
Util.track({ runtime = path })
vim.cmd("silent source " .. path)
Util.try(function()
vim.cmd("silent source " .. path)
end, "Failed to source `" .. path .. "`")
Util.track()
end
end)
Expand Down

0 comments on commit eeb06a5

Please sign in to comment.