Skip to content

Commit e233ebd

Browse files
committed
use xpcall for scanning
1 parent 3594014 commit e233ebd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

script/filewatch.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,13 @@ function m.watch(path, recursive, filter)
5252
if not filter or filter(fullpath:string()) then
5353
watch:add(fullpath:string())
5454
log.debug('Watch add:', fullpath:string())
55-
scanDirctory(fullpath)
55+
xpcall(scanDirctory, log.error, fullpath)
5656
end
5757
end
5858
end
5959
end
6060

61-
scanDirctory(fs.path(path))
61+
xpcall(scanDirctory, log.error, fs.path(path))
6262
end
6363
m._watchings[path] = {
6464
count = 1,

0 commit comments

Comments
 (0)