Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make more informative error messages when UploadError #3813

Closed
espdev opened this issue Mar 20, 2021 · 3 comments · Fixed by #9701
Closed

Make more informative error messages when UploadError #3813

espdev opened this issue Mar 20, 2021 · 3 comments · Fixed by #9701
Labels
kind/feature Feature requests/implementations status/triage This issue needs to be triaged

Comments

@espdev
Copy link

espdev commented Mar 20, 2021

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.

@espdev espdev added kind/feature Feature requests/implementations status/triage This issue needs to be triaged labels Mar 20, 2021
@dimbleby
Copy link
Contributor

seems like an easy merge request for anyone who's interested in this

@miohtama
Copy link

miohtama commented Apr 5, 2024

Poking this old issue.

I am now getting:

Connection Error: We were unable to connect to the repository, ensure the url is correct and can be reached.

On the main public PyPi repository. No idea if it's PyPi failing, or some issue on my local connection.

dimbleby added a commit to dimbleby/poetry that referenced this issue Sep 22, 2024
preserve the underlying exception from requests, so that it is available
when running with `--verbose`

fixes python-poetry#3813, superseds python-poetry#7004
dimbleby added a commit to dimbleby/poetry that referenced this issue Sep 22, 2024
preserve the underlying exception from requests, so that it is available
when running with `--verbose`

fixes python-poetry#3813, supersedes python-poetry#7004
radoering pushed a commit to dimbleby/poetry that referenced this issue Sep 29, 2024
preserve the underlying exception from requests, so that it is available
when running with `--verbose`

fixes python-poetry#3813, supersedes python-poetry#7004
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 30, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/feature Feature requests/implementations status/triage This issue needs to be triaged
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants