From 5e387328e5d8f97468bfd493828a9324289ac95b Mon Sep 17 00:00:00 2001 From: Matteo Collina Date: Thu, 23 Jan 2025 08:51:10 -0800 Subject: [PATCH] Update docs/docs/api/Errors.md Co-authored-by: Carlos Fuentes --- docs/docs/api/Errors.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/docs/docs/api/Errors.md b/docs/docs/api/Errors.md index 771e716671a..dfba3b39ce0 100644 --- a/docs/docs/api/Errors.md +++ b/docs/docs/api/Errors.md @@ -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 === ''` instead to avoid inconsistencies. ### `SocketError` The `SocketError` has a `.socket` property which holds socket metadata: