Skip to content

Commit 643ca14

Browse files
lpincatargos
authored andcommitted
doc: fix order of events when request is aborted
PR-URL: #24779 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Daniel Bevenius <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]>
1 parent c300aaa commit 643ca14

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

doc/api/http.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -2075,9 +2075,9 @@ will be emitted in the following order:
20752075
* `'socket'`
20762076
* (`req.abort()` called here)
20772077
* `'abort'`
2078-
* `'close'`
20792078
* `'error'` with an error with message `'Error: socket hang up'` and code
20802079
`'ECONNRESET'`
2080+
* `'close'`
20812081

20822082
If `req.abort()` is called after the response is received, the following events
20832083
will be emitted in the following order:
@@ -2087,10 +2087,10 @@ will be emitted in the following order:
20872087
* `'data'` any number of times, on the `res` object
20882088
* (`req.abort()` called here)
20892089
* `'abort'`
2090+
* `'aborted'` on the `res` object
20902091
* `'close'`
2091-
* `'aborted'` on the `res` object
2092-
* `'end'` on the `res` object
2093-
* `'close'` on the `res` object
2092+
* `'end'` on the `res` object
2093+
* `'close'` on the `res` object
20942094

20952095
Note that setting the `timeout` option or using the `setTimeout()` function will
20962096
not abort the request or do anything besides add a `'timeout'` event.

0 commit comments

Comments
 (0)