From 0c54b5f33f8e4c567552b30c3b7f80a32f2dd371 Mon Sep 17 00:00:00 2001 From: Robert Nagy Date: Fri, 1 May 2020 10:56:45 +0200 Subject: [PATCH] fixup! http: emit 'error' on aborted client response --- doc/api/http.md | 6 +++--- test/parallel/test-http-aborted.js | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/doc/api/http.md b/doc/api/http.md index 3adccd1b127912..21f477304fcdb2 100644 --- a/doc/api/http.md +++ b/doc/api/http.md @@ -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 @@ -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 @@ -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 diff --git a/test/parallel/test-http-aborted.js b/test/parallel/test-http-aborted.js index ff45469e45e3c2..f1a1e8b82bb94e 100644 --- a/test/parallel/test-http-aborted.js +++ b/test/parallel/test-http-aborted.js @@ -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); @@ -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(); }));