atom/node-pathwatcher — pull request #53 by glasser (2014-12-22 18:53:56+00:00)
Title: Expose kevent/inotify errnos on thrown error

The error will have a numeric 'code', which is the system errno
value (NOT the uv errno value).

(I spent quite a while trying to convert this into a string like `'ENOENT'` but uv actually makes that hard by not exposing their internal errno conversion API (https://github.com/libuv/libuv/issues/79); and posix only gives you `strerror` which gets you the English description rather than the short string.)

This change also stops it from being a TypeError, which seems reasonable... makes sense to use NaNThrowTypeError for "String required" but not for "syscall failed".

This change also ensures that if the initial inotify/kqueue init syscall failed, we make Watch calls fail immediately instead of trying to call the follow-up call.