Skip to content

Commit 9d87e9f

Browse files
jstewmonszmarczak
authored andcommittedJul 25, 2018
Document TimeoutError
1 parent 11a2f0f commit 9d87e9f

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed
 

‎readme.md

+6-3
Original file line numberDiff line numberDiff line change
@@ -186,9 +186,9 @@ Query string object that will be added to the request URL. This will override th
186186

187187
Type: `number` `Object`
188188

189-
Milliseconds to wait for the server to end the response before aborting request with `ETIMEDOUT` error (a.k.a. `request` property). By default there's no timeout.
189+
Milliseconds to wait for the server to end the response before aborting request with [`got.TimeoutError`](#gottimeouterror) error (a.k.a. `request` property). By default there's no timeout.
190190

191-
This also accepts an object with separate `lookup`, `connect`, `socket`, `response` and `request` fields to specify granular timeouts for each phase of the request.
191+
This also accepts an `object` with the following fields to constrain the duration of each phase of the request lifecycle:
192192

193193
- `lookup` starts when a socket is assigned and ends when the hostname has been resolved. Does not apply when using a Unix domain socket.
194194
- `connect` starts when `lookup` completes (or when the socket is assigned if lookup does not apply to the request) and ends when the socket is connected.
@@ -412,7 +412,7 @@ Extends parent options. Avoid using [object spread](https://developer.mozilla.or
412412
```js
413413
const a = {headers: {cat: 'meow'}};
414414
const b = {headers: {dog: 'woof'}};
415-
415+
416416
{...a, ...b} // => {headers: {dog: 'woof'}}
417417
got.assignOptions(a, b) // => {headers: {cat: 'meow', dog: 'woof'}}
418418
```
@@ -455,6 +455,9 @@ When given an unsupported protocol.
455455

456456
When the request is aborted with `.cancel()`.
457457

458+
#### got.TimeoutError
459+
460+
When the request is aborted due to a [timeout](#timeout)
458461

459462
## Aborting the request
460463

0 commit comments

Comments
 (0)
Please sign in to comment.