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 messages in case of unexpected response from the API #236

Closed
corrieriluca opened this issue Aug 21, 2024 · 6 comments
Closed
Labels
enhancement New feature or request hacktoberfest

Comments

@corrieriluca
Copy link

Is your feature request related to a problem? Please describe.
When a problem happens on the API side (network error, rate limiting, version not found...) a generic message unexpected value returned by API is displayed by tenv which does not indicate the nature of the problem and could make the investigation more complicated.

Describe the solution you'd like
Clear error messages, for example:

  • Version not available:
    $ tenv tf install 1.42.0
    Installing Terraform 1.42.0
    Fetching release information from https://releases.hashicorp.com/terraform/1.42.0/index.json
    error: API returned 404 Not Found, version may not be available
    
  • Rate limiting from GitHub:
    $ tenv tg install latest
    Fetching all releases information from https://api.github.com/repos/gruntwork-io/terragrunt/releases
    error: API returned 429 Too Many Requests, you are rate limited by GitHub, consider using a token with the TENV_GITHUB_TOKEN environment variable
    

Describe alternatives you've considered
As a quick first attempt this kind of errors could be displayed only in verbose mode before implementing human-readable error messages.

@dvaumoron dvaumoron added the enhancement New feature or request label Aug 21, 2024
@dvaumoron
Copy link
Contributor

Good idea, I will take a look on what could be done

@Nmishin
Copy link
Collaborator

Nmishin commented Aug 21, 2024

@dvaumoron Denis, you don't mind if I will check it? I've already started working on it a bit, and plan to proceed on weekends :)

@dvaumoron
Copy link
Contributor

@Nmishin , have you made progress on this improvement ?

@Nmishin
Copy link
Collaborator

Nmishin commented Nov 23, 2024

@dvaumoron yes, I have something, will send it to review tomorrow

@dvaumoron
Copy link
Contributor

Partially done with #288

@Nmishin
Copy link
Collaborator

Nmishin commented Nov 29, 2024

done in #289

@Nmishin Nmishin closed this as completed Nov 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request hacktoberfest
Projects
None yet
Development

No branches or pull requests

4 participants