Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not throw on missing directory/file. #87

Closed
wtgtybhertgeghgtwtg opened this issue Jan 20, 2017 · 1 comment
Closed

Do not throw on missing directory/file. #87

wtgtybhertgeghgtwtg opened this issue Jan 20, 2017 · 1 comment

Comments

@wtgtybhertgeghgtwtg
Copy link
Collaborator

From this comment.
Trying to watch a file that does not exist with node_watcher terminates the process. chokidar handles this by wrapping fs.watch in a try-catch block and swallowing the error if it's an ENOENT or ENOTDIR.
Does something like that sound okay?

@amasad
Copy link
Owner

amasad commented Feb 13, 2017

Expanding on what I mentioned on #88:

  1. internally watchdir is (and should) never be called with a non-directory.
  2. If sane is called with a non-directory for a root that's an obvious user error that should be reported
  3. Swallowing user errors is bad UX. Imagine if I had a typo, for example, it can be really hard to debug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants