-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
awsproviderlint: New Check: Prefer %w verb for *awserr.Error in returning errors with context #12991
Labels
linter
Pertains to changes to or issues with the various linters.
provider
Pertains to the provider itself, rather than any interaction with AWS.
technical-debt
Addresses areas of the codebase that need refactoring or redesign.
Comments
breathingdust
added
technical-debt
Addresses areas of the codebase that need refactoring or redesign.
provider
Pertains to the provider itself, rather than any interaction with AWS.
labels
Apr 24, 2020
This comment has been minimized.
This comment has been minimized.
bflad
added
the
linter
Pertains to changes to or issues with the various linters.
label
Oct 28, 2020
ewbankkit
added a commit
to farhanangullia/terraform-provider-aws
that referenced
this issue
Aug 11, 2021
ewbankkit
added a commit
that referenced
this issue
Sep 21, 2021
ewbankkit
added a commit
to nijave/terraform-provider-aws
that referenced
this issue
Sep 21, 2021
Superseded by #15891. |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
linter
Pertains to changes to or issues with the various linters.
provider
Pertains to the provider itself, rather than any interaction with AWS.
technical-debt
Addresses areas of the codebase that need refactoring or redesign.
Community Note
Description
Go 1.13 introduced a new error formatting verb, %w, which allows the original error to be wrapped and checked by type in consumers, rather than just checking by value.
Previously, it was not (easily) possible to have an AWS Go SDK helper function return a contextual message along the original error, e.g. this would not work
Now with the %w verb in the AWS Go SDK calling function and the now updated isAWSErr() helper function, the error checking can work as expected.
Flagged Code
Passing Code
References
The text was updated successfully, but these errors were encountered: