Skip to content

Commit 5e38732

Browse files
mcollinametcoder95
andauthored
Update docs/docs/api/Errors.md
Co-authored-by: Carlos Fuentes <me@metcoder.dev>
1 parent c00e498 commit 5e38732

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

docs/docs/api/Errors.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@ import { errors } from 'undici'
2828
| `ResponseExceededMaxSizeError` | `UND_ERR_RES_EXCEEDED_MAX_SIZE` | response body exceed the max size allowed |
2929
| `SecureProxyConnectionError` | `UND_ERR_PRX_TLS` | tls connection to a proxy failed |
3030

31-
Be aware that some errors are created by dispatcher. If you plan to check `instanceof errors.UndiciError` then don't use the default global dispatcher,
32-
as it may come from another `undici` module and have its own errors classes.
33-
31+
Be aware of the possible difference between the global dispatcher version and the actual undici version you might be using. We recommend to avoid the check `instanceof errors.UndiciError` and seek for the `error.code === '<error_code>'` instead to avoid inconsistencies.
3432
### `SocketError`
3533

3634
The `SocketError` has a `.socket` property which holds socket metadata:

0 commit comments

Comments
 (0)