Skip to content

Commit

Permalink
fix: catch extension errors when configuring
Browse files Browse the repository at this point in the history
  • Loading branch information
stevearc committed Dec 15, 2022
1 parent 53b742a commit a1dd2f8
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lua/resession/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,13 @@ M.setup = function(config)
if ext_config then
local ext = util.get_extension(ext_name)
if ext and ext.config then
ext.config(ext_config)
local ok, err = pcall(ext.config, ext_config)
if not ok then
vim.notify(
string.format("Error configuring resession extension %s: %s", ext_name, err),
vim.log.levels.ERROR
)
end
end
end
end
Expand Down

0 comments on commit a1dd2f8

Please sign in to comment.