Skip to content

Commit

Permalink
fix(core.norg.journal): add proper error handling for `vim.loop.fs_sc…
Browse files Browse the repository at this point in the history
…andir`
  • Loading branch information
vhyrro committed Jan 16, 2023
1 parent 4edf80e commit 4a9a5fe
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lua/neorg/modules/core/norg/journal/module.lua
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,9 @@ module.private = {
return title
end

vim.loop.fs_scandir(folder_name .. neorg.configuration.pathsep, function(_, handle)
vim.loop.fs_scandir(folder_name .. neorg.configuration.pathsep, function(err, handle)
assert(not err, neorg.lib.lazy_string_concat("Unable to generate TOC for directory '", folder_name, "' - ", err))

while true do
-- Name corresponds to either a YYYY-mm-dd.norg file, or just the year ("nested" strategy)
local name, type = vim.loop.fs_scandir_next(handle)
Expand Down

0 comments on commit 4a9a5fe

Please sign in to comment.