Skip to content

Commit 721fd28

Browse files
committed
fix: properly error when failing to load module using :Neorg module load
1 parent 7d9bd33 commit 721fd28

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lua/neorg/modules/core/neorgcmd/module.lua

+5-1
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,11 @@ module.neorg_post_load = module.public.sync
435435

436436
module.on_event = function(event)
437437
if event.type == "core.neorgcmd.events.module.load" then
438-
modules.load_module(event.content[1])
438+
local ok = pcall(modules.load_module, event.content[1])
439+
440+
if not ok then
441+
vim.notify(string.format("Module `%s` does not exist!", event.content[1]), vim.log.levels.ERROR, {})
442+
end
439443
end
440444

441445
if event.type == "core.neorgcmd.events.module.list" then

0 commit comments

Comments
 (0)