-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fs: make fs.watch error message more useful
PR-URL: #5616 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Trevor Norris <[email protected]>
- Loading branch information
Showing
1 changed file
with
4 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1382,7 +1382,10 @@ function FSWatcher() { | |
this._handle.onchange = function(status, event, filename) { | ||
if (status < 0) { | ||
self._handle.close(); | ||
const error = errnoException(status, `watch ${filename}`); | ||
const error = !filename ? | ||
errnoException(status, 'Error watching file for changes:') : | ||
errnoException(status, | ||
`Error watching file ${filename} for changes:`); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
cjihrig
Contributor
|
||
error.filename = filename; | ||
self.emit('error', error); | ||
} else { | ||
|
Why is there a colon at these end of these?