Found several documentation inaccuracies while reading through the API docs:
GettingStarted.md
- Error handling example uses
errors.ClassName.code (static property) but code is an instance property only
errors.ConnectTimeoutError.code evaluates to undefined since .code is set in the constructor, not as a static property
- The
switch/case branches never match — should use string literals like "UND_ERR_CONNECT_TIMEOUT" instead
RetryHandler.md
- Constructor signature documents 3 params but code takes 2:
new RetryHandler(dispatchOptions, retryHandlers, [retryOptions]) should be new RetryHandler(opts, { dispatch, handler })
- Default
methods missing TRACE: doc says ["GET", "PUT", "HEAD", "OPTIONS", "DELETE"] but source has ["GET", "HEAD", "OPTIONS", "PUT", "DELETE", "TRACE"]
- Default
errorCodes missing EHOSTUNREACH and EPIPE: doc lists 7 codes, source has 9
RetryAgent.md
- Return type says
ProxyAgent but should be RetryAgent
- Same
methods and errorCodes defaults issues as RetryHandler.md
BalancedPool.md
- Property heading says
Pool.stats but should be BalancedPool.stats
Errors.md
Socks5ProxyError code says UND_ERR_SOCKS5* (with wildcard) but the actual default is UND_ERR_SOCKS5 (no wildcard)
MockAgent.md
- Example calls
clearAllCallHistory() but the actual method name is clearCallHistory() (no "All")
Dispatcher.md
- Broken link:
Dispatch.md should be Dispatcher.md
onBodySent callback not documented in the DispatchHandler interface (it is validated in lib/core/util.js)
Happy to open a PR fixing these.
Found several documentation inaccuracies while reading through the API docs:
GettingStarted.md
errors.ClassName.code(static property) butcodeis an instance property onlyerrors.ConnectTimeoutError.codeevaluates toundefinedsince.codeis set in the constructor, not as a static propertyswitch/casebranches never match — should use string literals like"UND_ERR_CONNECT_TIMEOUT"insteadRetryHandler.md
new RetryHandler(dispatchOptions, retryHandlers, [retryOptions])should benew RetryHandler(opts, { dispatch, handler })methodsmissingTRACE: doc says["GET", "PUT", "HEAD", "OPTIONS", "DELETE"]but source has["GET", "HEAD", "OPTIONS", "PUT", "DELETE", "TRACE"]errorCodesmissingEHOSTUNREACHandEPIPE: doc lists 7 codes, source has 9RetryAgent.md
ProxyAgentbut should beRetryAgentmethodsanderrorCodesdefaults issues as RetryHandler.mdBalancedPool.md
Pool.statsbut should beBalancedPool.statsErrors.md
Socks5ProxyErrorcode saysUND_ERR_SOCKS5*(with wildcard) but the actual default isUND_ERR_SOCKS5(no wildcard)MockAgent.md
clearAllCallHistory()but the actual method name isclearCallHistory()(no "All")Dispatcher.md
Dispatch.mdshould beDispatcher.mdonBodySentcallback not documented in theDispatchHandlerinterface (it is validated inlib/core/util.js)Happy to open a PR fixing these.