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

fs: improve errors from watch, watchFile and unwatchFile #19345

Closed
wants to merge 2 commits into from

Commits on Mar 14, 2018

  1. fs: remove watcher state errors for fs.watch

    - Remove ERR_FS_WATCHER_ALREADY_STARTED and
      ERR_FS_WATCHER_NOT_STARTED because those two situations should
      result in noop instead of errors for consistency with the
      documented behavior of fs.watchFile.
      This partially reverts nodejs#19089
    - Update comments about this behavior.
    
    Refs: nodejs#19089
    joyeecheung committed Mar 14, 2018
    Configuration menu
    Copy the full SHA
    2463216 View commit details
    Browse the repository at this point in the history
  2. fs: improve errors in watchFile and unwatchFile

    - Check if the watcher is active in JS land before
      invoking the binding, act as a noop if the state of
      the watcher does not match the expectation. This
      avoids firing 'stop' when the watcher is already
      stopped.
    - Update comments, validate more arguments and
      the type of the handle.
    - Handle the errors from uv_fs_poll_start
    - Create an `IsActive` helper method on StatWatcher
    joyeecheung committed Mar 14, 2018
    Configuration menu
    Copy the full SHA
    9a41128 View commit details
    Browse the repository at this point in the history