-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
aws: errors with context #1705
aws: errors with context #1705
Conversation
11af9fa
to
6f1bf45
Compare
6f1bf45
to
83c2323
Compare
/lgtm |
I see that files |
provider/aws/aws.go
Outdated
@@ -166,7 +167,7 @@ func NewAWSProvider(awsConfig AWSConfig) (*AWSProvider, error) { | |||
SharedConfigState: session.SharedConfigEnable, | |||
}) | |||
if err != nil { | |||
return nil, err | |||
return nil, errors.Wrap(err, "failed to instantiate AWS session") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe ...
return nil, fmt.Errorf("failed to instantiate AWS session: %w", err)
See https://blog.golang.org/go1.13-errors for reference.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I hesitated to introduce a dep to a Go version; but just checked the CI and Dockerfile are using 1.14 so I assume we're good with go >= 1.13. Updated.
When faced with errors from cloud providers (like "Throttling: Rate exceeded"), it's not always easy to find what operation caused the failure, and what action was aborted, if any, Let's make it easier to identify an error source (and affected object when possible) by providing more context (and by using easy to find error messages).
83c2323
to
b64e3ac
Compare
/lgtm |
/kind cleanup |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bpineau, Raffo The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
When faced with errors from cloud providers (like "Throttling: Rate exceeded"), it's not always easy to find what operation caused the failure, and what action was aborted, if any.
Let's make it easier to identify an error source (and affected object when possible) on AWS by providing more context (and by using easy to find error messages).
Checklist