node-klaw-sync
node-klaw-sync copied to clipboard
Exception thrown when directory contains broken symlink.
Right now, the code uses statSync
, but this attempts to read through symlinks, and will throw ENOENT
for any broken symlinks.
IMO, this call should be lstatSync
as it gives users more control (and also doesn't throw exceptions if the link is broken).
I found this will using a library that depends on klawSync, I wasn't aware that there was a broken symlink in the directory, but nonetheless I don't think the library should assume that users always want to read through symlinks. It would be better to let the user library break and they can deal with it accordingly.