Skip to content

Make more informative error messages when UploadError #3813

@espdev

Description

@espdev

Why do you hide the error info when ConnectionError occurred?

class UploadError(Exception):
def __init__(self, error: Union[ConnectionError, HTTPError, str]) -> None:
if isinstance(error, HTTPError):
message = "HTTP Error {}: {}".format(
error.response.status_code, error.response.reason
)
elif isinstance(error, ConnectionError):
message = (
"Connection Error: We were unable to connect to the repository, "
"ensure the url is correct and can be reached."
)
else:
message = str(error)
super(UploadError, self).__init__(message)

The message is absolutely not informative.

Connection Error: We were unable to connect to the repository, ensure the url is correct and can be reached.
  1. The repository URL is not shown
  2. The real ConnectionError message is hidden

It is impossible to understand what happened. In my case I'm getting ('Connection aborted.', ConnectionAbortedError(10053)) error with my private repository. I could not understand what was happening until I added debug prints to poetry code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/featureFeature requests/implementationsstatus/triageThis issue needs to be triaged

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions