From 453d7dbcbd99dd0b0fe003ca65f5a651c83cf064 Mon Sep 17 00:00:00 2001 From: Simone Busoli Date: Mon, 7 Jun 2021 16:01:49 +0200 Subject: [PATCH] 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 --- doc/api/stream.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/doc/api/stream.md b/doc/api/stream.md index 2a49308959a972..39dfbc8ab5c8bb 100644 --- a/doc/api/stream.md +++ b/doc/api/stream.md @@ -629,9 +629,8 @@ changes: The `writable.write()` method writes some data to the stream, and calls the supplied `callback` once the data has been fully handled. If an error -occurs, the `callback` *may or may not* be called with the error as its -first argument. To reliably detect write errors, add a listener for the -`'error'` event. The `callback` is called asynchronously and before `'error'` is +occurs, the `callback` will be called with the error as its +first argument. The `callback` is called asynchronously and before `'error'` is emitted. The return value is `true` if the internal buffer is less than the