Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions doc/api/stream.md
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,18 @@ file.end('world!');
// Writing more now is not allowed!
```

[`stream.end()`][stream-end] will error with (in order of precedence):
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you clarify if it will throw or emit an error?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about now?

* `ERR_STREAM_WRITE_AFTER_END` if `chunk` is not nully and
[`stream.end()`][stream-end] has been called.
Comment thread
ronag marked this conversation as resolved.
Outdated
* `ERR_STREAM_DESTROYED` if `chunk` is not nully and
[`stream.destroy()`][stream-destroy] has been called.
Comment thread
ronag marked this conversation as resolved.
Outdated
* `ERR_INVALID_ARG_TYPE` if `chunk` is not nully and
`chunk` is not a `string` when not in `objectMode`.
Comment thread
lundibundi marked this conversation as resolved.
Outdated
* `ERR_STREAM_ALREADY_FINISHED` if
[`writable.writableFinished`][].
Comment thread
ronag marked this conversation as resolved.
Outdated
* Any error emitted by the instance through `'error'` before
Comment thread
ronag marked this conversation as resolved.
Outdated
[`writable.writableFinished`][].
Comment thread
ronag marked this conversation as resolved.
Outdated

##### writable.setDefaultEncoding(encoding)
<!-- YAML
added: v0.11.15
Expand Down Expand Up @@ -619,6 +631,13 @@ write('hello', () => {

A `Writable` stream in object mode will always ignore the `encoding` argument.

`stream.write()` will error with (in order of precedence):
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same

* `ERR_STREAM_WRITE_AFTER_END` if [`stream.end()`][stream-end] has been called.
* `ERR_STREAM_DESTROYED` if [`stream.destroy()`][stream-destroy] has been called.
Comment thread
ronag marked this conversation as resolved.
Outdated
* `ERR_STREAM_NULL_VALUES` if `chunk` is `null`.
* `ERR_INVALID_ARG_TYPE` if `chunk` is not a `string` when not in `objectMode`.
* Any error forwarded by `writable._write()`.
Comment thread
ronag marked this conversation as resolved.
Outdated

### Readable Streams

Readable streams are an abstraction for a *source* from which data is
Expand Down