Repository navigation
Unhandled 'error' event on aborted request #36931
Copy link
Copy link
Closed
Labels
confirmed-bugIssues and PRs for confirmed bugs.Issues and PRs for confirmed bugs.httpIssues and PRs related to the http subsystem.Issues and PRs related to the http subsystem.linuxIssues and PRs related to the Linux platform.Issues and PRs related to the Linux platform.macosIssues and PRs related to the macOS platform.Issues and PRs related to the macOS platform.
Description
Activity
- addedhttpIssues and PRs related to the http subsystem.Issues and PRs related to the http subsystem.macosIssues and PRs related to the macOS platform.Issues and PRs related to the macOS platform.
on Jan 14, 2021 onSocketNT()is called before the'error'event is emitted but there are no listeners. The listener is added bytickOnSocket().cc: @nodejs/http
@ronag it's not that. The error is emitted after
onSocketNT()is called. Adding an'error'listener here https://github.com/nodejs/node/blob/v15.5.1/lib/_http_client.js#L814-L819 would be sufficient.Reacted by Robert Nagy and Vasco Santos- addedconfirmed-bugIssues and PRs for confirmed bugs.Issues and PRs for confirmed bugs.linuxIssues and PRs related to the Linux platform.Issues and PRs related to the Linux platform.
on Jan 15, 2021 Might have been solved with #36863
Needs a regression test either way.
#36863 fixes this only if no agent is used. It does not fix the example in the issue description.
Reacted by Robert Nagy and Vasco Santos- added a commit that references this issue
on Jan 16, 2021 - added a commit that references this issue
on Feb 16, 2021 - added a commit that references this issue
on May 22, 2026
Metadata
Metadata
Assignees
Labels
confirmed-bugIssues and PRs for confirmed bugs.Issues and PRs for confirmed bugs.httpIssues and PRs related to the http subsystem.Issues and PRs related to the http subsystem.linuxIssues and PRs related to the Linux platform.Issues and PRs related to the Linux platform.macosIssues and PRs related to the macOS platform.Issues and PRs related to the macOS platform.
What steps will reproduce the bug?
How often does it reproduce? Is there a required condition?
Always. No required condition.
What is the expected behavior?
The error is handled by the
'error'event listener.What do you see instead?
The error is not handled.
Additional information
If
req.abort()is removed the error is correctly handled.