docs(errors): clarify timeout error codes and related options#4856
Open
theamodhshetty wants to merge 2 commits intonodejs:mainfrom
Open
docs(errors): clarify timeout error codes and related options#4856theamodhshetty wants to merge 2 commits intonodejs:mainfrom
theamodhshetty wants to merge 2 commits intonodejs:mainfrom
Conversation
metcoder95
reviewed
Mar 3, 2026
docs/docs/api/Errors.md
Outdated
| | `UND_ERR_BODY_TIMEOUT` | While reading the response body, no new data arrived before the body timeout elapsed. | [`bodyTimeout`](/docs/docs/api/Client.md#parameter-clientoptions) | | ||
| | `UND_ERR_SOCKET` | A generic socket-level failure happened (including some timeout-related socket errors). | Inspect `error.socket` and adjust your dispatcher/client socket settings. | | ||
|
|
||
| > **Note**: `UND_ERR_SOCKET_TIMEOUT` is not an Undici error code. |
Member
There was a problem hiding this comment.
I'd suggest to remove this, as it can lead to ambiguity and misunderstanding; rather let's just list the codes we support so any code outside of the list can be understood as non supported or non originated from undici
Contributor
Author
There was a problem hiding this comment.
Agreed. I removed that note in 379617c so the section only documents the supported Undici error codes and does not speculate about unsupported ones.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4856 +/- ##
=======================================
Coverage 93.14% 93.15%
=======================================
Files 109 109
Lines 34239 34254 +15
=======================================
+ Hits 31893 31910 +17
+ Misses 2346 2344 -2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This improves timeout-related error documentation in
docs/docs/api/Errors.md.It adds:
connect.timeout,headersTimeout,bodyTimeout)UND_ERR_SOCKET_TIMEOUTis not an Undici error codefetch-oriented example showing how to configure timeouts viasetGlobalDispatcherThis is intended to make issues like
UND_ERR_*_TIMEOUTeasier to understand and act on, especially for users coming fromfetch.Closes #1865.
Testing
npm run lintwas attempted locally before dependencies were installed, so eslint was not available in this environment.