Skip to content

doc: error modes of writable - #29745

Closed
ronag wants to merge 8 commits into
nodejs:masterfrom
nxtedition:doc-write-errors
Closed

doc: error modes of writable#29745
ronag wants to merge 8 commits into
nodejs:masterfrom
nxtedition:doc-write-errors

Conversation

@ronag

@ronagronag commented Sep 28, 2019

Copy link
Copy Markdown
Member

Documents the error modes of Writable

Checklist

@nodejs-github-botnodejs-github-bot added doc Issues and PRs related to the documentations. stream Issues and PRs related to the stream subsystem. labels Sep 28, 2019
@ronagronag changed the title doc: document error modes of writable.writedoc: error modes of writable.writeSep 28, 2019
@ronag
ronagforce-pushed the doc-write-errors branch 4 times, most recently from 6c6beba to b2c4f5aCompareSeptember 28, 2019 08:11
@ronagronag changed the title doc: error modes of writable.writedoc: error modes of writableSep 28, 2019
@ronag
ronagforce-pushed the doc-write-errors branch 5 times, most recently from 5e422d0 to b030cf2CompareSeptember 28, 2019 10:03
Comment threaddoc/api/stream.md Outdated
Comment threaddoc/api/stream.md Outdated
Comment threaddoc/api/stream.md Outdated
Comment threaddoc/api/stream.md Outdated
Comment threaddoc/api/stream.md Outdated
Comment threaddoc/api/stream.md Outdated
Co-Authored-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
@Trott

Trott commented Oct 1, 2019

Copy link
Copy Markdown
Member

Comment threaddoc/api/stream.md Outdated
Co-Authored-By: Rich Trott <rtrott@gmail.com>
@ronag
ronag requested a review from TrottNovember 24, 2019 09:56
@ronag

Copy link
Copy Markdown
MemberAuthor

Could this get another review from nodejs/streams?

@Trott

Copy link
Copy Markdown
Member

@nodejs/streams

Comment threaddoc/api/stream.md Outdated
// 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
MemberAuthor

Choose a reason for hiding this comment

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

How about now?

Comment threaddoc/api/stream.md Outdated

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

Comment threaddoc/api/stream.md Outdated
Comment threaddoc/api/stream.md Outdated
Co-Authored-By: Yorkie Liu <yorkiefixer@gmail.com>
Comment threaddoc/api/stream.md Outdated

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

`stream.write()` will call it's callback and emit `'error'`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
`stream.write()` will call it's callback and emit `'error'`
`stream.write()` will call its callback and emit `'error'`

Comment threaddoc/api/stream.md Outdated
Comment threaddoc/api/stream.md
Comment threaddoc/api/stream.md
Comment threaddoc/api/stream.md Outdated
Co-Authored-By: Denys Otrishko <9109612+lundibundi@users.noreply.github.com>
@yorkie

Copy link
Copy Markdown
Contributor

This PR seems to document how does the write/end methods emit the errors, it's a bit more easy to be changed in somehow and without changing this docs, if we would have links to functions, it will feel less.

@ronag

Copy link
Copy Markdown
MemberAuthor

This PR seems to document how does the write/end methods emit the errors, it's a bit more easy to be changed in somehow and without changing this docs, if we would have links to functions, it will feel less.

Sorry, I don't understand. Do you think you could try to rephrase?

@yorkie

Copy link
Copy Markdown
Contributor

Sorry, I don't understand. Do you think you could try to rephrase?

Never mind, I'm not proposing any changes on this PR. FYI, I was considering that it's easy to forget to update here when someone changed the algorithm of write/end in our streams.

@ronag

ronag commented Dec 1, 2019

Copy link
Copy Markdown
MemberAuthor

@yorkie@lundibundi Can this PR get your approvals and maybe land?

Comment threaddoc/api/stream.md Outdated
@lundibundi

Copy link
Copy Markdown
Member

ping @mcollina

Co-Authored-By: Denys Otrishko <9109612+lundibundi@users.noreply.github.com>
@lundibundi

Copy link
Copy Markdown
Member

@ronag

Copy link
Copy Markdown
MemberAuthor

Currently blocked by whatever happens with #29197 which affects some details of this.

@lundibundilundibundi added the blocked PRs that are blocked by other issues or PRs. label Dec 30, 2019
@BridgeAR

Copy link
Copy Markdown
Member

This needs a rebase.

@ronag

Copy link
Copy Markdown
MemberAuthor

The error modes of streams is still a fluid situation so I think it's better re-open this at a future stage.

@ronagronag closed this Feb 14, 2020
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

blockedPRs that are blocked by other issues or PRs.docIssues and PRs related to the documentations.streamIssues and PRs related to the stream subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants

@ronag@Trott@yorkie@lundibundi@BridgeAR@mcollina@vsemozhetbyt@nodejs-github-bot