Skip to content

docs: document missing error types in Errors.md#5339

Open
cesarvspr wants to merge 1 commit into
nodejs:mainfrom
cesarvspr:docs/document-missing-error-types
Open

docs: document missing error types in Errors.md#5339
cesarvspr wants to merge 1 commit into
nodejs:mainfrom
cesarvspr:docs/document-missing-error-types

Conversation

@cesarvspr
Copy link
Copy Markdown

@cesarvspr cesarvspr commented May 31, 2026

This relates to...

The errors documentation, which was missing several exported error classes. Closely related to the documentation gap noted in #1865 (timeout/error code explanations).

Rationale

docs/docs/api/Errors.md documents the error objects exposed via the errors key, but several classes that are actually exported from lib/core/errors.js were absent from the table. Users hitting these errors (error.code === '...') had no reference for them. This adds the missing rows so the table matches what undici exports.

Changes

Added the following rows to the errors table in docs/docs/api/Errors.md, with codes and descriptions matching the definitions in lib/core/errors.js:

Error Code
AbortError UND_ERR_ABORT
RequestRetryError UND_ERR_REQ_RETRY
ResponseError UND_ERR_RESPONSE
MaxOriginsReachedError UND_ERR_MAX_ORIGINS_REACHED
BalancedPoolMissingUpstreamError UND_ERR_BPL_MISSING_UPSTREAM
Socks5ProxyError UND_ERR_SOCKS5*
HTTPParserError HPE_*

Notes:

  • HTTPParserError extends Error (not UndiciError) and uses HPE_* codes; called out in its description so it doesn't contradict the existing "all errors below are extended from UndiciError" note.
  • Socks5ProxyError uses UND_ERR_SOCKS5* codes (e.g. UND_ERR_SOCKS5, UND_ERR_SOCKS5_AUTH_REJECTED).

Features

N/A

Bug Fixes

N/A

Breaking Changes and Deprecations

N/A — documentation only, no API changes.

Status

  • I have read and agreed to the Developer's Certificate of Origin
  • [S] Tested (docs-only, no code changed)
  • [S] Benchmarked (optional)
  • Documented
  • Review ready
  • In review
  • Merge ready

@cesarvspr cesarvspr force-pushed the docs/document-missing-error-types branch from b06ddff to 76c33c9 Compare May 31, 2026 06:53
The errors table was missing several error classes that are exported
from `undici`'s `errors` key: AbortError, RequestRetryError,
ResponseError, MaxOriginsReachedError, BalancedPoolMissingUpstreamError,
Socks5ProxyError and HTTPParserError. Add them with their codes and
descriptions, matching the definitions in lib/core/errors.js.

Signed-off-by: cesarvspr <vinicius_spr@hotmail.com>
@cesarvspr cesarvspr force-pushed the docs/document-missing-error-types branch from 76c33c9 to 5c3b2a1 Compare June 1, 2026 04:51
Copy link
Copy Markdown
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

lgtm

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.23%. Comparing base (dd1e50a) to head (5c3b2a1).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5339   +/-   ##
=======================================
  Coverage   93.23%   93.23%           
=======================================
  Files         110      110           
  Lines       36668    36668           
=======================================
  Hits        34189    34189           
  Misses       2479     2479           

☔ View full report in Codecov by Sentry.
📢 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.

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