docs: document missing error types in Errors.md by cesarvspr · Pull Request #5339 · nodejs/undici (original) (raw)
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:
HTTPParserErrorextendsError(notUndiciError) and usesHPE_*codes; called out in its description so it doesn't contradict the existing "all errors below are extended fromUndiciError" note.Socks5ProxyErrorusesUND_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