mirror of
https://github.com/folke/lazy.nvim.git
synced 2025-04-18 20:36:45 +00:00
feat: error handler for loading modules, config and init, with custom error formatting
This commit is contained in:
parent
bad1b1f87d
commit
7933ae11c4
2 changed files with 56 additions and 7 deletions
|
@ -154,7 +154,7 @@ function M.init_plugins()
|
|||
end
|
||||
if plugin.init then
|
||||
Util.track(plugin.name)
|
||||
plugin.init()
|
||||
Util.try(plugin.init, "Failed to run `init` for **" .. plugin.name .. "**")
|
||||
Util.track()
|
||||
end
|
||||
if plugin.opt == false then
|
||||
|
@ -235,7 +235,7 @@ function M.load(plugins, reason, opts)
|
|||
end
|
||||
|
||||
if plugin.config then
|
||||
plugin.config()
|
||||
Util.try(plugin.config, "Failed to run `config` for " .. plugin.name)
|
||||
end
|
||||
|
||||
plugin.loaded.time = Util.track().time
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue