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(); }));