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

config: Return error from optFns in LoadDefaultConfig #1562

Merged
merged 2 commits into from Jan 24, 2022

Conversation

pingleig
Copy link
Member

Built in LoadOptions (e.g. WithRegion) all returns nil. However LoadOptions is public so user can define options that returns error. I find existing code does not ignore error from resolvers or loaders and feel LoadDefaultConfig should do the same.

for _, fn := range resolvers {
if err := fn(ctx, &cfg, cs); err != nil {
// TODO provide better error?
return aws.Config{}, err
}
}

Copy link
Contributor

@jasdel jasdel left a comment

Choose a reason for hiding this comment

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

Thanks for fixing this bug @pingleig. I've added changelog entry for the fix. We'll get this merged in and included in the SDKs next release.

@jasdel jasdel merged commit 484478f into aws:main Jan 24, 2022
jrichard8 pushed a commit to jrichard8/aws-sdk-go-v2 that referenced this pull request Feb 14, 2022
Adds handling of return error in LoadDefaultConfig when processing functional options for LoadOptions.
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.

None yet

2 participants