docs: fix multiple inaccuracies in API documentation#5384
Open
AliMahmoudDev wants to merge 1 commit into
Open
Conversation
Fixes nodejs#5382 - GettingStarted.md: use string literals instead of static .code (undefined) - RetryHandler.md: fix constructor signature, add TRACE to default methods, add EHOSTUNREACH/EPIPE to default errorCodes - RetryAgent.md: fix return type (ProxyAgent -> RetryAgent), same defaults fixes - BalancedPool.md: fix property heading (Pool.stats -> BalancedPool.stats) - Errors.md: fix Socks5ProxyError code (UND_ERR_SOCKS5* -> UND_ERR_SOCKS5) - MockAgent.md: fix method name (clearAllCallHistory -> clearCallHistory) - Dispatcher.md: fix broken link (Dispatch.md -> Dispatcher.md), add onBodySent to DispatchHandler
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5384 +/- ##
=======================================
Coverage 93.25% 93.25%
=======================================
Files 110 110
Lines 36752 36752
=======================================
Hits 34274 34274
Misses 2478 2478 ☔ View full report in Codecov by Harness. 🚀 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.
Fixes #5382
Changes
GettingStarted.md
errors.ClassName.code(static property) but.codeis only set as an instance property in the constructor — it evaluates toundefinedand the switch/case branches never match. Changed to string literals ("UND_ERR_CONNECT_TIMEOUT", etc.)RetryHandler.md
(dispatchOptions, retryHandlers, [retryOptions])but code takes 2(opts, { dispatch, handler })withretryOptionsnested insideoptsTRACEto defaultmethodsarrayEHOSTUNREACHandEPIPEto defaulterrorCodesarrayRetryAgent.md
ProxyAgent→RetryAgentmethodsanderrorCodesdefaults fixes as RetryHandlerBalancedPool.md
Pool.stats→BalancedPool.statsErrors.md
Socks5ProxyErrorerror code:UND_ERR_SOCKS5*(wildcard) →UND_ERR_SOCKS5MockAgent.md
clearAllCallHistory()→clearCallHistory()Dispatcher.md
Dispatch.md→Dispatcher.mdonBodySentcallback toDispatchHandlerinterface documentationAll changes verified against the actual source code in
lib/.