Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 3cfb313

Browse filesBrowse files
evanlucasMylesBorins
authored andcommitted
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>
1 parent 080368b commit 3cfb313
Copy full SHA for 3cfb313

File tree

Expand file treeCollapse file tree

1 file changed

+1
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+1
-0
lines changed
Open diff view settings
Collapse file

‎doc/api/fs.md‎

Copy file name to clipboardExpand all lines: doc/api/fs.md
+1Lines changed: 1 addition & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -1397,6 +1397,7 @@ fs.open('myfile', 'wx', (err, fd) => {
13971397
fs.exists('myfile', (exists) => {
13981398
if (exists) {
13991399
fs.open('myfile', 'r', (err, fd) => {
1400+
if (err) throw err;
14001401
readMyData(fd);
14011402
});
14021403
} else {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.