-
Notifications
You must be signed in to change notification settings - Fork 49
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
fix: resolve region only when profile credentials require it #582
Conversation
A new generated diff is ready to view: __generated-main...__generated-fix-unnecessary-region-resolution |
A new generated diff is ready to view: __generated-main...__generated-fix-unnecessary-region-resolution |
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.
Fix and ship!
@@ -115,40 +116,49 @@ public class ProfileCredentialsProvider( | |||
return creds | |||
} | |||
|
|||
private suspend fun resolveRegionOrThrow(platformProvider: PlatformProvider): String = | |||
runCatching { resolveRegion(platformProvider) } |
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.
fix
resolveRegion already throws an exception that includes the entire chain that was tried. I think we should keep that behavior rather than throwing a new exception that lacks these details.
A new generated diff is ready to view: __generated-main...__generated-fix-unnecessary-region-resolution |
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
A new generated diff is ready to view: __generated-main...__generated-fix-unnecessary-region-resolution |
Issue #
#581
Description of changes
This change removes the eager resolution of region in the profile credentials provider, which is unnecessary and can cause exceptions even when the region isn't needed (e.g., for static profile credentials).
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.