stream: writable write emit all errors async
Currently write
sometimes throws/emits synchronously and sometimes asynchronously. Also, the callback is sometimes called before and sometimes after the 'error'
.
This PR brings consistency in "correctly" emitting all errors in write
asynchronously after the callback.
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
tests and/or benchmarks are included -
documentation is changed or added -
commit message follows commit guidelines