★ wanayoo — archive 1999 https://github.com/nodejs/node/commit/3cfb313e8eNouvelle recherche | Portail wanayoo
Skip to content
Permalink
Browse files
doc: add error check to fs example
Previously, the err passed to the callback of fs.open() was not checked.

PR-URL: #18681
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
  • Loading branch information
evanlucas authored and MylesBorins committed Feb 21, 2018
1 parent 080368b commit 3cfb313e8e3ae841d9a6156dd64a37111f8ab44d
Showing with 1 addition and 0 deletions.
  1. +1 −0 doc/api/fs.md
@@ -1397,6 +1397,7 @@ fs.open('myfile', 'wx', (err, fd) => {
fs.exists('myfile', (exists) => {
if (exists) {
fs.open('myfile', 'r', (err, fd) => {
if (err) throw err;
readMyData(fd);
});
} else {

0 comments on commit 3cfb313

Please sign in to comment.