Skip to content

Commit

Permalink
fs: throw errors on invalid paths synchronously
Browse files Browse the repository at this point in the history
- Throw getPathFromURL() and nullCheck() errors synchronously instead
  of deferring them to the next tick, since we already throw
  validatePath() errors synchronously.
- Merge nullCheck() into validatePath()
- Never throws in `fs.exists()`, instead, invoke the callback with
  false, or emit a warning when the callback is not a function.
  This is to bring it inline with fs.existsSync(), which never throws.
- Updates the comment of rethrow()
- Throw ERR_INVALID_ARG_VALUE for null checks

PR-URL: #18308
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
joyeecheung committed Feb 8, 2018
1 parent b505716 commit d8f7338
Show file tree
Hide file tree
Showing 7 changed files with 252 additions and 334 deletions.

0 comments on commit d8f7338

Please sign in to comment.