Skip to content

Commit

Permalink
doc: fix order of events when request is aborted
Browse files Browse the repository at this point in the history
PR-URL: #24779
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
  • Loading branch information
lpinca authored and BethGriggs committed Feb 12, 2019
1 parent 16a1f96 commit e9ad526
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions doc/api/http.md
Original file line number Diff line number Diff line change
Expand Up @@ -2081,9 +2081,9 @@ will be emitted in the following order:
* `'socket'`
* (`req.abort()` called here)
* `'abort'`
* `'close'`
* `'error'` with an error with message `'Error: socket hang up'` and code
`'ECONNRESET'`
* `'close'`

If `req.abort()` is called after the response is received, the following events
will be emitted in the following order:
Expand All @@ -2093,10 +2093,10 @@ will be emitted in the following order:
* `'data'` any number of times, on the `res` object
* (`req.abort()` called here)
* `'abort'`
* `'aborted'` on the `res` object
* `'close'`
* `'aborted'` on the `res` object
* `'end'` on the `res` object
* `'close'` on the `res` object
* `'end'` on the `res` object
* `'close'` on the `res` object

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

0 comments on commit e9ad526

Please sign in to comment.