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 error type check when retrying #376

Merged
merged 1 commit into from
Aug 23, 2022
Merged

Conversation

itsjaspermilan
Copy link
Contributor

@itsjaspermilan itsjaspermilan commented Aug 22, 2022

🛠️ Description

There is an issue where URL Errors would get swallowed by the retry logic put in place for HTTP requests. This makes it hard to debug when a user may have an invalid login configuration so a check was put into place that identifies the type of error that was received and directs the user to a more helpful error message if necessary.

Fixes: #375

🚢 Release Note

* all: Prevents the app from crashing when a `*url.Error` is received while retrying HTTP requests. [GH-376]

🏗️ Acceptance tests

  • Are there any feature flags that are required to use this functionality?
  • Have you added an acceptance test for the functionality being added?
  • Have you run the acceptance tests on this branch?

Output from acceptance testing:

$ make testacc TESTARGS='-run=TestAccAwsHvnOnly'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/... -v -run=TestAccAwsHvnOnly -timeout 210m
testing: warning: no tests to run
PASS
ok      github.com/hashicorp/terraform-provider-hcp/internal/clients    (cached) [no tests to run]
testing: warning: no tests to run
PASS
ok      github.com/hashicorp/terraform-provider-hcp/internal/consul     (cached) [no tests to run]
testing: warning: no tests to run
PASS
ok      github.com/hashicorp/terraform-provider-hcp/internal/input      (cached) [no tests to run]
=== RUN   TestAccAwsHvnOnly
--- PASS: TestAccAwsHvnOnly (123.99s)
PASS
ok      github.com/hashicorp/terraform-provider-hcp/internal/provider   124.314s
...

@itsjaspermilan itsjaspermilan requested a review from a team August 22, 2022 19:43
Copy link
Contributor

@bcmdarroch bcmdarroch left a comment

Choose a reason for hiding this comment

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

🎉 Nice quick fix! Looking forward to getting more robust error helpers in the Go SDK to help even more. :)

@itsjaspermilan itsjaspermilan merged commit e9b587c into main Aug 23, 2022
@itsjaspermilan itsjaspermilan deleted the tce-retry-error-casting-bug branch August 23, 2022 18:33
rizkybiz pushed a commit to rizkybiz/terraform-provider-hcp that referenced this pull request Aug 25, 2022
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.

Panic on interface conversion of OrganizationServiceListDefault
2 participants