GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |
GeezerVison is showing github.com — fs: fix StatWatcher to handle error codes by brendanashworth · Pull Request #2028 · nodejs/node Conversation
Contributor
Previously, Ref: nodejs/node-v0.x-archive#25469 CI: https://jenkins-iojs.nodesource.com/job/iojs+any-pr+multi/65/
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unused import.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks, fixed!
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsPreviously, fs.watchFile() would call the callback even if the file does not exist. This is erroneous and is fixed by correctly handling the error code provided. Ref: nodejs/node-v0.x-archive#25469 Fixes: nodejs#1745
brendanashworth
force-pushed
the
fix/fs-watch-nonexistent-file
branch
from
28b3b30 to
34bd27c
Compare
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @thefourtheye pointed out in an earlier revision that this means that the callback won't get called on ENOENT. I think that already happens if you watch e.g. That does seem unfortunate, though. Invoking the callback at least gives the user a chance to handle the ENOENT case because then you can check that
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @bnoordhuis Yup, if the callback is not fired then the users will not know if the code is working or not. This could be a debugging nightmare.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can leave this in and mark the current functionality as correct. I marked the issue as
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If the functionality is different from 0.10, I think we should at least have something in the docs regarding the difference.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Closed
Contributor
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
brendanashworth
added a commit
to brendanashworth/io.js
that referenced
this pull request
When fs.watchFile encounters an ENOENT error, it invokes the given callback with some error data. This caused an issue as it was different behaviour than Node v0.10. Instead of changing this behaviour, document it and add a test. Ref: nodejs#1745 Ref: nodejs#2028
brendanashworth
added a commit
that referenced
this pull request
When fs.watchFile encounters an ENOENT error, it invokes the given callback with some error data. This caused an issue as it was different behaviour than Node v0.10. Instead of changing this behaviour, document it and add a test. Ref: #1745 Ref: #2028 Reviewed-By: Ben Noordhuis <[email protected]> PR-URL: #2093
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ReviewersNo reviewsUh oh!
There was an error while loading. Please reload this page. AssigneesNo one assignedLabels
fs
ProjectsMilestoneNo milestoneDevelopmentSuccessfully merging this pull request may close these issues. fs.watchFile calling listener on non-existing filesUh oh!
There was an error while loading. Please reload this page. Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later. | |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |