summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorRobert Nagy <ronagy@icloud.com>2019-08-24 16:33:46 +0200
committerRich Trott <rtrott@gmail.com>2019-09-30 10:56:29 -0700
commitf663b31cc2aecd585e73430504f3d7f5252851ca (patch)
treeb727bf953711f9f83fa9b7dca13e30f07d17d694 /doc
parent634a9a97f4b380390352543452aed6c7c9defcb4 (diff)
downloadandroid-node-v8-f663b31cc2aecd585e73430504f3d7f5252851ca.tar.gz
android-node-v8-f663b31cc2aecd585e73430504f3d7f5252851ca.tar.bz2
android-node-v8-f663b31cc2aecd585e73430504f3d7f5252851ca.zip
stream: always invoke callback before emitting error
Ensure the callback is always invoked before emitting the error in both sync and async case. PR-URL: https://github.com/nodejs/node/pull/29293 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'doc')
-rw-r--r--doc/api/stream.md3
1 files changed, 2 insertions, 1 deletions
diff --git a/doc/api/stream.md b/doc/api/stream.md
index 3761df57e9..5fd73cb2fb 100644
--- a/doc/api/stream.md
+++ b/doc/api/stream.md
@@ -571,7 +571,8 @@ 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.
+`'error'` event. If `callback` is called with an error, it will be called
+before the `'error'` event is emitted.
The return value is `true` if the internal buffer is less than the
`highWaterMark` configured when the stream was created after admitting `chunk`.