Skip to content

docs(timeout): clarify timeout format in error messages#17668

Open
LouisLau-art wants to merge 1 commit intoastral-sh:mainfrom
LouisLau-art:fix-timeout-error-clarification
Open

docs(timeout): clarify timeout format in error messages#17668
LouisLau-art wants to merge 1 commit intoastral-sh:mainfrom
LouisLau-art:fix-timeout-error-clarification

Conversation

@LouisLau-art
Copy link

Fixes #16940.

Currently, if a network timeout occurs, uv displays the timeout as 30s. This leads users to try setting UV_HTTP_TIMEOUT=60s, which fails because it expects a plain integer.

This PR:

  1. Improves the error message when a network timeout occurs to explicitly state that the value should be an integer in seconds and provides an example.
  2. Updates the environment variable parsing logic to provide a specific suggestion (expected an integer (in seconds)) when parsing any variable containing TIMEOUT fails and the value ends with s.

Verified with:

UV_HTTP_TIMEOUT=60s cargo run venv
# error: Failed to parse environment variable `UV_HTTP_TIMEOUT` with invalid value `60s`: invalid digit found in string; expected an integer (in seconds), e.g., '60' instead of '60s'

When a network timeout occurs, explicitly mention that UV_HTTP_TIMEOUT should be an integer in seconds. Additionally, provide a helpful suggestion when parsing any environment variable containing 'TIMEOUT' fails due to an 's' suffix.
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.

Clarify UV_HTTP_TIMEOUT format in error message

1 participant