Handle Errors Gracefully - #78
Conversation
| mtime: new Date(0), | ||
| error: err.toString(), | ||
| code: err.code, | ||
| isDirectory: function () { return false } |
There was a problem hiding this comment.
I believe your changes will expose this stat object to the users in the previous commits. I assume you made these fake values to prevent code from breaking, but it'll still break since you didn't provide all the values in a native Node.js stat object here. You'll want to make sure all the properties are covered if you're going to provide them at all, otherwise that's going to be even more confusing to the user, imo.
There was a problem hiding this comment.
I just pushed another commit to the stat-first branch that converts to a w3 FileAPI-esque object sooner, which corrects that issue.
There was a problem hiding this comment.
Will that show up in this pr at all?
There was a problem hiding this comment.
No, I made separate branches for each change and only based each change on the fewest number of commits needed to demonstrate the change.
All of the PRs are in order. I’ll go back and add when other PR the depend on.
| var fileList = files.map(function (file, i) { | ||
| return { name: file, stat: stats[i] }; | ||
| }); | ||
| }).filter(function (file) { return file.stat }); |
There was a problem hiding this comment.
Will this actually be filtering anything out since the code below is providing a stat object even on error?
Addresses #76
Skip over ENOENT files, return bogus stat object for other fs.stat errors.