diff options
author | Robert Nagy <ronagy@icloud.com> | 2019-08-24 16:33:46 +0200 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2019-09-27 15:45:17 -0700 |
commit | 3de5eae6dbe503485b95bdeb8bddbd67e4613d59 (patch) | |
tree | 83c652a7259d4328b9783c92eddb8b8ab49e2f05 /doc | |
parent | c48467408d6f520b3dda86e34c8f4688acdd52b7 (diff) | |
download | android-node-v8-3de5eae6dbe503485b95bdeb8bddbd67e4613d59.tar.gz android-node-v8-3de5eae6dbe503485b95bdeb8bddbd67e4613d59.tar.bz2 android-node-v8-3de5eae6dbe503485b95bdeb8bddbd67e4613d59.zip |
stream: invoke callback before emitting error always
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.md | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/doc/api/stream.md b/doc/api/stream.md index d4dbe54dbc..48b478a58e 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`. |