Skip to content

docs(errors): clarify timeout error codes and related options - #4856

Merged
metcoder95 merged 1 commit into
nodejs:mainfrom
theamodhshetty:codex/docs-timeout-errors-guide
Oct 8, 2026
Merged

metcoder95 merged 1 commit into
nodejs:mainfrom
theamodhshetty:codex/docs-timeout-errors-guide

Conversation

@theamodhshetty

@theamodhshetty theamodhshetty commented Mar 3, 2026 •

Copy link
Copy Markdown
Contributor

The errors reference explains individual error classes but does not give readers a single view of timeout codes, their dispatcher settings, or how to configure those settings for fetch.

This adds a timeout-code table and a global-dispatcher example. The unsupported-code note requested for removal stays removed. The branch is rebased onto current main, preserving the newer error-class reference and using current documentation links.

Validation: the JavaScript example passes node --check; its dispatcher options and error-code mapping were checked against the current implementation; relative Client.md links resolve; git diff --check passes. No runtime code changes. The previous Node.js 20/macOS job failure could not be investigated because its logs have expired (HTTP 410); fresh CI is needed on this head.

Comment thread 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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-commenter

codecov-commenter commented Mar 6, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.11%. Comparing base (f850c68) to head (bf6723b).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4856   +/-   ##
=======================================
  Coverage   86.11%   86.11%           
=======================================
  Files         115      115           
  Lines       45686    45686           
=======================================
  Hits        39343    39343           
  Misses       6343     6343           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@theamodhshetty

Copy link
Copy Markdown
Contributor Author

Review follow-up: the requested removal of the unsupported-error-code note is already included in 379617c3, and this PR has an approval. I checked the reported checks: the remaining failed job is Node.js 20 on macOS; its old run logs now return HTTP 410, so I cannot verify the cause or call it a flaky failure.

Could a maintainer rerun that job or advise whether the documentation change needs any further adjustment before merge?

@theamodhshetty
theamodhshetty force-pushed the codex/docs-timeout-errors-guide branch from 379617c to bf6723b Compare October 1, 2026 21:58
@theamodhshetty

Copy link
Copy Markdown
Contributor Author

I also found and resolved the branch conflicts against current main. Rebased as bf6723be, retained the newer error-class reference, repaired stale Client.md links, and kept the unsupported-code note removed.

Validation: example syntax (node --check), dispatcher construction, documented error-code values, relative documentation links, and git diff --check all pass. No runtime code changes. Fresh CI and review should use this new head; the earlier approval applied to the old commit.

@theamodhshetty

Copy link
Copy Markdown
Contributor Author

Fresh CI on rebased head bf6723bec6e5be551d00b7acd9d8adf8be998763 now gives a concrete failure to investigate: Node 22.23.3 aborts in node::StreamBase::CallJSOnreadMethod with Assertion failed: onread->IsFunction() while running test/http2-request-never-settles.js.

The same failure appears on Ubuntu and Windows. This PR changes only docs/docs/api/Errors.md; no runtime or test files differ from its base. Lint, TypeScript types, dependency review, CodeQL, and benchmarks passed. The test matrix is still running, so I am not claiming CI is green or calling this flaky. Maintainer guidance on the runtime failure would help unblock this documentation PR.

@metcoder95
metcoder95 merged commit c3de472 into nodejs:main Oct 8, 2026
34 of 38 checks passed
@github-actions github-actions Bot mentioned this pull request Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants