@@ -3654,7 +3654,7 @@ the following events will be emitted in the following order:
3654
3654
* (connection closed here)
3655
3655
* ` 'aborted' ` on the ` res ` object
3656
3656
* ` 'error' ` on the ` res ` object with an error with message
3657
- ` 'Error: aborted' ` and code ` 'ECONNRESET' ` .
3657
+ ` 'Error: aborted' ` and code ` 'ECONNRESET' `
3658
3658
* ` 'close' `
3659
3659
* ` 'close' ` on the ` res ` object
3660
3660
@@ -3663,7 +3663,7 @@ events will be emitted in the following order:
3663
3663
3664
3664
* (` req.destroy() ` called here)
3665
3665
* ` 'error' ` with an error with message ` 'Error: socket hang up' ` and code
3666
- ` 'ECONNRESET' `
3666
+ ` 'ECONNRESET' ` , or the error with which ` req.destroy() ` was called
3667
3667
* ` 'close' `
3668
3668
3669
3669
If ` req.destroy() ` is called before the connection succeeds, the following
@@ -3672,7 +3672,7 @@ events will be emitted in the following order:
3672
3672
* ` 'socket' `
3673
3673
* (` req.destroy() ` called here)
3674
3674
* ` 'error' ` with an error with message ` 'Error: socket hang up' ` and code
3675
- ` 'ECONNRESET' `
3675
+ ` 'ECONNRESET' ` , or the error with which ` req.destroy() ` was called
3676
3676
* ` 'close' `
3677
3677
3678
3678
If ` req.destroy() ` is called after the response is received, the following
@@ -3683,8 +3683,8 @@ events will be emitted in the following order:
3683
3683
* ` 'data' ` any number of times, on the ` res ` object
3684
3684
* (` req.destroy() ` called here)
3685
3685
* ` 'aborted' ` on the ` res ` object
3686
- * ` 'error' ` on the ` res ` object with an error with message
3687
- ` 'Error: aborted' ` and code ` 'ECONNRESET' ` .
3686
+ * ` 'error' ` on the ` res ` object with an error with message ` 'Error: aborted' `
3687
+ and code ` 'ECONNRESET' ` , or the error with which ` req.destroy() ` was called
3688
3688
* ` 'close' `
3689
3689
* ` 'close' ` on the ` res ` object
3690
3690
@@ -3722,9 +3722,11 @@ events will be emitted in the following order:
3722
3722
Setting the ` timeout ` option or using the ` setTimeout() ` function will
3723
3723
not abort the request or do anything besides add a ` 'timeout' ` event.
3724
3724
3725
- Passing an ` AbortSignal ` and then calling ` abort ` on the corresponding
3725
+ Passing an ` AbortSignal ` and then calling ` abort() ` on the corresponding
3726
3726
` AbortController ` will behave the same way as calling ` .destroy() ` on the
3727
- request itself.
3727
+ request. Specifically, the ` 'error' ` event will be emitted with an error with
3728
+ the message ` 'AbortError: The operation was aborted' ` , the code ` 'ABORT_ERR' `
3729
+ and the ` cause ` , if one was provided.
3728
3730
3729
3731
## ` http.validateHeaderName(name[, label]) `
3730
3732
0 commit comments