Skip to content

Commit

Permalink
Update docs/docs/api/Errors.md
Browse files Browse the repository at this point in the history
Co-authored-by: Carlos Fuentes <me@metcoder.dev>
  • Loading branch information
mcollina and metcoder95 authored Jan 23, 2025
1 parent c00e498 commit 5e38732
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions docs/docs/api/Errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ import { errors } from 'undici'
| `ResponseExceededMaxSizeError` | `UND_ERR_RES_EXCEEDED_MAX_SIZE` | response body exceed the max size allowed |
| `SecureProxyConnectionError` | `UND_ERR_PRX_TLS` | tls connection to a proxy failed |

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,
as it may come from another `undici` module and have its own errors classes.

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.
### `SocketError`

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

0 comments on commit 5e38732

Please sign in to comment.