@@ -3606,7 +3606,7 @@ the following events will be emitted in the following order:
3606
3606
* (connection closed here)
3607
3607
* ` 'aborted' ` on the ` res ` object
3608
3608
* ` 'error' ` on the ` res ` object with an error with message
3609
- ` 'Error: aborted' ` and code ` 'ECONNRESET' ` .
3609
+ ` 'Error: aborted' ` and code ` 'ECONNRESET' `
3610
3610
* ` 'close' `
3611
3611
* ` 'close' ` on the ` res ` object
3612
3612
@@ -3615,7 +3615,7 @@ events will be emitted in the following order:
3615
3615
3616
3616
* (` req.destroy() ` called here)
3617
3617
* ` 'error' ` with an error with message ` 'Error: socket hang up' ` and code
3618
- ` 'ECONNRESET' `
3618
+ ` 'ECONNRESET' ` , or the error with which ` req.destroy() ` was called
3619
3619
* ` 'close' `
3620
3620
3621
3621
If ` req.destroy() ` is called before the connection succeeds, the following
@@ -3624,7 +3624,7 @@ events will be emitted in the following order:
3624
3624
* ` 'socket' `
3625
3625
* (` req.destroy() ` called here)
3626
3626
* ` 'error' ` with an error with message ` 'Error: socket hang up' ` and code
3627
- ` 'ECONNRESET' `
3627
+ ` 'ECONNRESET' ` , or the error with which ` req.destroy() ` was called
3628
3628
* ` 'close' `
3629
3629
3630
3630
If ` req.destroy() ` is called after the response is received, the following
@@ -3635,8 +3635,8 @@ events will be emitted in the following order:
3635
3635
* ` 'data' ` any number of times, on the ` res ` object
3636
3636
* (` req.destroy() ` called here)
3637
3637
* ` 'aborted' ` on the ` res ` object
3638
- * ` 'error' ` on the ` res ` object with an error with message
3639
- ` 'Error: aborted' ` and code ` 'ECONNRESET' ` .
3638
+ * ` 'error' ` on the ` res ` object with an error with message ` 'Error: aborted' `
3639
+ and code ` 'ECONNRESET' ` , or the error with which ` req.destroy() ` was called
3640
3640
* ` 'close' `
3641
3641
* ` 'close' ` on the ` res ` object
3642
3642
@@ -3674,9 +3674,11 @@ events will be emitted in the following order:
3674
3674
Setting the ` timeout ` option or using the ` setTimeout() ` function will
3675
3675
not abort the request or do anything besides add a ` 'timeout' ` event.
3676
3676
3677
- Passing an ` AbortSignal ` and then calling ` abort ` on the corresponding
3677
+ Passing an ` AbortSignal ` and then calling ` abort() ` on the corresponding
3678
3678
` AbortController ` will behave the same way as calling ` .destroy() ` on the
3679
- request itself.
3679
+ request. Specifically, the ` 'error' ` event will be emitted with an error with
3680
+ the message ` 'AbortError: The operation was aborted' ` , the code ` 'ABORT_ERR' `
3681
+ and the ` cause ` , if one was provided.
3680
3682
3681
3683
## ` http.validateHeaderName(name[, label]) `
3682
3684
0 commit comments