Skip to content

Commit 0bdeeda

Browse files
simonebtargos
authored andcommitted
doc: update write callback documentation
- replace _*may or may not* be called_ with _will be called_ because the callback is always called - remove _To reliably detect write errors, add a listener for the `'error'` event_ because the `error` event will NOT be emitted if a write occurs after the stream has been closed PR-URL: #38959 Fixes: #38704 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
1 parent 173292b commit 0bdeeda

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

doc/api/stream.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -627,9 +627,8 @@ changes:
627627

628628
The `writable.write()` method writes some data to the stream, and calls the
629629
supplied `callback` once the data has been fully handled. If an error
630-
occurs, the `callback` *may or may not* be called with the error as its
631-
first argument. To reliably detect write errors, add a listener for the
632-
`'error'` event. The `callback` is called asynchronously and before `'error'` is
630+
occurs, the `callback` will be called with the error as its
631+
first argument. The `callback` is called asynchronously and before `'error'` is
633632
emitted.
634633

635634
The return value is `true` if the internal buffer is less than the

0 commit comments

Comments
 (0)