undici icon indicating copy to clipboard operation
undici copied to clipboard

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

Open theamodhshetty opened this issue 8 months ago • 1 comments

Summary

This improves timeout-related error documentation in docs/docs/api/Errors.md.

It adds:

  • a dedicated timeout error section that maps codes to when they are thrown
  • direct links from each timeout code to the relevant configuration options (connect.timeout, headersTimeout, bodyTimeout)
  • a note clarifying that UND_ERR_SOCKET_TIMEOUT is not an Undici error code
  • a fetch-oriented example showing how to configure timeouts via setGlobalDispatcher

This is intended to make issues like UND_ERR_*_TIMEOUT easier to understand and act on, especially for users coming from fetch.

Closes #1865.

Testing

  • Documentation-only change.
  • npm run lint was attempted locally before dependencies were installed, so eslint was not available in this environment.

theamodhshetty avatar Mar 03 '26 03:03 theamodhshetty

Codecov Report

:white_check_mark: All modified and coverable lines are covered by tests. :white_check_mark: Project coverage is 93.15%. Comparing base (0bf0a2a) to head (379617c). :warning: Report is 6 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4856   +/-   ##
=======================================
  Coverage   93.14%   93.15%           
=======================================
  Files         109      109           
  Lines       34239    34254   +15     
=======================================
+ Hits        31893    31910   +17     
+ Misses       2346     2344    -2     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

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

codecov-commenter avatar Mar 06 '26 07:03 codecov-commenter