Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
doc: implicit fs callbacks don't throw in v0.10
But they will in v0.12.

Re #5005.
  • Loading branch information
bnoordhuis authored and isaacs committed Mar 13, 2013
1 parent 7b7235a commit fa05e8a
Showing 1 changed file with 4 additions and 19 deletions.
23 changes: 4 additions & 19 deletions doc/api/fs.markdown
Expand Up @@ -63,26 +63,11 @@ Relative path to filename can be used, remember however that this path will be
relative to `process.cwd()`.

Most fs functions let you omit the callback argument. If you do, a default
callback is used that rethrows errors. To get a trace to the original call
site, set the NODE_DEBUG environment variable:
callback is used that ignores errors, but prints a deprecation
warning.

$ cat script.js
function bad() {
require('fs').readFile('/');
}
bad();

$ env NODE_DEBUG=fs node script.js
fs.js:66
throw err;
^
Error: EISDIR, read
at rethrow (fs.js:61:21)
at maybeCallback (fs.js:79:42)
at Object.fs.readFile (fs.js:153:18)
at bad (/path/to/script.js:2:17)
at Object.<anonymous> (/path/to/script.js:5:1)
<etc.>
**IMPORTANT**: Omitting the callback is deprecated. v0.12 will throw the
errors as exceptions.


## fs.rename(oldPath, newPath, [callback])
Expand Down

0 comments on commit fa05e8a

Please sign in to comment.