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

Improve error message on deps.get permission errors #627

Open
ericmj opened this issue Nov 8, 2018 · 0 comments
Open

Improve error message on deps.get permission errors #627

ericmj opened this issue Nov 8, 2018 · 0 comments

Comments

@ericmj
Copy link
Member

ericmj commented Nov 8, 2018

This error gives no hints on how to solve the issue:

> mix deps.get
Failed to fetch record for 'hexpm:acme/my_package' from registry (using cache)
This could be because the package does not exist, it was spelled incorrectly or you don't have permissions to it

We can do a few checks and give a few hints when this happens:

  1. Check in config if there is an authenticated user
  2. Check if user has access to organization
  3. Check if email is verified
  4. Check if package actually exists (list existing packages if it doesn't)

Note that some of these checks can only be performed if we also have a read API key, which is not always the case for example in CI or users who authenticated against organization with mix hex.organization auth.

We may get this error multiple times when fetching dependencies so make sure we only print this once and that it stands out.

We can do similar checks for API errors but let's start with this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant