Skip to content

Improve network error message #8641

@uranusjr

Description

@uranusjr

What's the problem this feature will solve?
pip automatically retries after hitting a network error, but the warning it emits is cryptic to users without experience on networking applications.

Recent examples: #7424 #8639.

The typical message a user gets would be something like:

WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after
connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.VerifiedHTTPSConnection
object at 0x0000020EA6576108>, 'Connection to pypi.org timed out. (connect timeout=15)')': /some/url/

This is not too difficult to discern the error message as a client side networking issue with some Python and network experience. Less experienced users, however, cannot understand what to do to the cryptic output, and end up posting issues.

Describe the solution you'd like
Following the recent effort to format more user-friendly error messages, output a more descriptive message that says

  • What is likely happening.
  • What can the user do to the error.
  • Link to some documentation for further reading.

Additional context
I have not thought deep into how this should be implemented, to be honest. We should probably do two things:

  • Make the retry warning more descriptive by replacing the Retry(...) and ConnectTimeoutError(...) objects’ appearances (__repr__?) in it.
  • Wrap the network call, and output the user-friendly message described above when the retry limit is hit.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C: error messagesImproving error messagesUXUser experience related

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions