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

Display better messages on legacy repo HTTP errors #2459

Merged

Conversation

dan-hipschman
Copy link
Contributor

Changes

This change gives a clear message to users when there's an error connecting to a private repo.

Current message:

$ export POETRY_HTTP_BASIC_PYPI_LOCAL_PASSWORD="incorrect-password"
$ poetry add private-package

[ValueError]
Could not find a matching version of package private-package

New message

  RepositoryError

  401 Client Error: Unauthorized for url: https://xyz.jfrog.io/xyz/api/pypi/pip/simple/private-package/

Notes:

  • This PR will supersede: Return a clear error when HTTP calls to legacy repo fail, instead of PackageNotFound #1072. This PR is similar but doesn't introduce a new dependency.
  • This will cause poetry to error out if it can't connect to a private repo, whereas currently it will ignore it. This seems better. However, there may be people who have an unused private repo configured, to which poetry can't connect. They'll start getting an error message. It should be an easy fix for them though.
  • There might also possibly be some private repos that return (non-404) errors for certain endpoints, and it's conceivable that some user actually depends on this. E.g., maybe their repo returns 400 for /pytest, and they depend on that so poetry continues on to try PyPI. This seems like it would be an issue with the repo, but I'm just thinking through all the possible cases.

Pull Request Check List

  • Added tests for changed code.
  • Updated documentation for changed code. (seems unnecessary)

@finswimmer finswimmer requested a review from a team May 28, 2020 18:11
@finswimmer finswimmer added the area/error-handling Bad error messages/insufficient error handling label May 28, 2020
@dan-hipschman
Copy link
Contributor Author

Does anyone have a few minutes to take a look at this? It's a pretty small change, and fixes an issue that has come up at my company a few times. Thanks so much! :)

@finswimmer finswimmer changed the base branch from develop to master August 15, 2020 06:31
Copy link
Member

@finswimmer finswimmer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for your contribution 👍

Copy link

github-actions bot commented Mar 1, 2024

This pull request 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 Mar 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/error-handling Bad error messages/insufficient error handling
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants