Skip to content

chore: improve error message, since version is nil#191

Closed
bschaatsbergen wants to merge 2 commits intohashicorp:mainfrom
bschaatsbergen:c/improve-err-message
Closed

chore: improve error message, since version is nil#191
bschaatsbergen wants to merge 2 commits intohashicorp:mainfrom
bschaatsbergen:c/improve-err-message

Conversation

@bschaatsbergen
Copy link
Copy Markdown

@bschaatsbergen bschaatsbergen commented Apr 4, 2024

When hc-install looks for a release that we don't have binaries for (e.g. terraform 1.0.0 darwin/arm64), we print an error message containing a nil:

 $ ./hc-install install -version 1.0.0 terraform
hc-install: will install [email protected]
failed to install [email protected]: no ZIP archive found for terraform <nil> darwin/arm64

At first, I assumed there might be a bug in hc-install because of seeing that nil. After checking the Release index I noticed we started building darwin/arm64 binaries starting from 1.1.

I'm assuming that the nil is the result of marshaling the Release API response, which can't list the product and doesn't return a version?

This PR changes the error message to:

hc-install: will install [email protected]
failed to install [email protected]: darwin/arm64 ZIP archive for terraform not found

@bschaatsbergen
Copy link
Copy Markdown
Author

Closing this in favor of #192

@bschaatsbergen bschaatsbergen deleted the c/improve-err-message branch April 4, 2024 09:38
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.

1 participant