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

Add source details to error message #138

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Add source details to error message #138

wants to merge 2 commits into from

Conversation

austinvalle
Copy link
Member

A hackish fix to close #133, another alternative could be submitting a PR upstream to hc-install to add Stringer implementations for each src.Source implementation.

The upstream hc-install src.Source interface does not provide a String() function or equivalent to retrieve relevant information about the sources.

This PR takes some of the source detail from the logging message and adds all source detail information to the end of an error message. It's provides maybe too much information now instead of none 😆.

# Example w/ incorrect version env variable
cannot run Terraform provider tests: error ensuring Terraform CLI binary: failed to obtain product version from "https://releases.hashicorp.com/terraform/1.5.2/index.json": 404 Not Found  -  attempted source(s): [Terraform CLI source of releases.hashicorp.com exact version "1.5.2" for installation in: /var/folders/t8/1tjpvj_d24x8yl0st5qswzf80000gp/T/plugintest-terraform4283162721]

# Example w/ network error
cannot run Terraform provider tests: error ensuring Terraform CLI binary: Get "https://releases.hashicorp.com/terraform/1.5.0/index.json": dial tcp: lookup releases.hashicorp.com: no such host -  attempted source(s): [Terraform CLI source of releases.hashicorp.com exact version "1.5.0" for installation in: /var/folders/t8/1tjpvj_d24x8yl0st5qswzf80000gp/T/plugintest-terraform856199534]

@austinvalle austinvalle requested a review from a team as a code owner June 12, 2023 18:15
@austinvalle austinvalle marked this pull request as draft June 12, 2023 19:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error message when Terraform CLI cannot be loaded from sources does not list sources
1 participant