Skip to content

doc: clarify http error events after calling destroy() - #46903

Merged
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
zbjornson:doc-http-destroy
Mar 26, 2023
Merged

doc: clarify http error events after calling destroy()#46903
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
zbjornson:doc-http-destroy

Conversation

@zbjornson

Copy link
Copy Markdown
Contributor

Clarifies the errors after calling destroy(), as well as aborting a passed AbortController.


Aside, the statement "Passing an AbortSignal and then calling abort() on the corresponding AbortController will behave the same way as calling .destroy()" appears correct for Node.js v19, but incorrect for Node.js v16 (didn't test versions between those). Specifically, calling controller.abort()after the 'response' event has no effect in v16.

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/http
  • @nodejs/net

@nodejs-github-botnodejs-github-bot added doc Issues and PRs related to the documentations. http Issues or PRs related to the http subsystem. labels Mar 1, 2023
Comment threaddoc/api/http.md
Passing an `AbortSignal` and then calling `abort()` on the corresponding
`AbortController` will behave the same way as calling `.destroy()` on the
request itself.
request. Specifically, the `'error'` event will be emitted with an error with

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.

Nit

Suggested change
request. Specifically, the `'error'` event will be emitted with an error with
request itself. Specifically, the `'error'` event will be emitted with an error with

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Was going for brevity. "Itself" doesn't seem to add clarity. What do you think?

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.

I dont think its a necessary change to this pr, Id leave it as it was previously

Comment threaddoc/api/http.md
Comment on lines +3725 to +3726
request. Specifically, the `'error'` event will be emitted with an error with
the message `'AbortError: The operation was aborted'`, the code `'ABORT_ERR'`

@marco-ippolitomarco-ippolitoMar 2, 2023

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.

Suggested change
request. Specifically, the `'error'` event will be emitted with an error with
the message `'AbortError: The operation was aborted'`, the code `'ABORT_ERR'`
request. Specifically, the `'error'` event will be emitted with the message `'AbortError: The operation was aborted'`, the code `'ABORT_ERR'`

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

This parallels the wording in the bullet points above and makes it clear that the argument is an Error and not a string.

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.

It sounds a bit reduntant to me, feel free to ignore

@mcollinamcollina left a comment

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.

lgtm

@lpincalpinca added the commit-queue Add this label to land a pull request using GitHub Actions. label Mar 26, 2023
@nodejs-github-botnodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Mar 26, 2023
@nodejs-github-bot
nodejs-github-bot merged commit f0ade70 into nodejs:mainMar 26, 2023
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Landed in f0ade70

@zbjornson
zbjornson deleted the doc-http-destroy branch March 26, 2023 21:09
RafaelGSS pushed a commit that referenced this pull request Apr 5, 2023
PR-URL: #46903
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
@RafaelGSSRafaelGSS mentioned this pull request Apr 6, 2023
RafaelGSS pushed a commit that referenced this pull request Apr 6, 2023
PR-URL: #46903
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
RafaelGSS pushed a commit that referenced this pull request Apr 7, 2023
PR-URL: #46903
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
danielleadams pushed a commit that referenced this pull request Jul 6, 2023
PR-URL: #46903
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docIssues and PRs related to the documentations.httpIssues or PRs related to the http subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@zbjornson@nodejs-github-bot@mcollina@ShogunPanda@lpinca@marco-ippolito