Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

http: 'aborted' IncomingMessage should 'error' #33172

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
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
Prev Previous commit
Next Next commit
fixup! http: emit 'error' on aborted client response
  • Loading branch information
ronag committed May 1, 2020
commit 0c54b5f33f8e4c567552b30c3b7f80a32f2dd371
6 changes: 3 additions & 3 deletions doc/api/http.md
Original file line number Diff line number Diff line change
Expand Up @@ -2404,7 +2404,7 @@ the following events will be emitted in the following order:
* (connection closed here)
* `'aborted'` on the `res` object
* `'error'` on the `res` object with an error with message
`'Error: socket hang up'` and code `'ECONNRESET'`.
`'Error: aborted'` and code `'ECONNRESET'`.
* `'close'`
* `'close'` on the `res` object

Expand Down Expand Up @@ -2434,7 +2434,7 @@ events will be emitted in the following order:
* (`req.destroy()` called here)
* `'aborted'` on the `res` object
* `'error'` on the `res` object with an error with message
`'Error: socket hang up'` and code `'ECONNRESET'`.
`'Error: aborted'` and code `'ECONNRESET'`.
* `'close'`
* `'close'` on the `res` object

Expand Down Expand Up @@ -2465,7 +2465,7 @@ events will be emitted in the following order:
* `'abort'`
* `'aborted'` on the `res` object
* `'error'` on the `res` object with an error with message
`'Error: socket hang up'` and code `'ECONNRESET'`.
`'Error: aborted'` and code `'ECONNRESET'`.
* `'close'`
* `'close'` on the `res` object

Expand Down
2 changes: 2 additions & 0 deletions test/parallel/test-http-aborted.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const assert = require('assert');
}));
req.on('error', common.mustCall(function(err) {
assert.strictEqual(err.code, 'ECONNRESET');
assert.strictEqual(err.message, 'aborted');
server.close();
}));
assert.strictEqual(req.aborted, false);
Expand All @@ -27,6 +28,7 @@ const assert = require('assert');
}));
res.on('error', common.mustCall((err) => {
assert.strictEqual(err.code, 'ECONNRESET');
assert.strictEqual(err.message, 'aborted');
}));
req.abort();
}));
Expand Down