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

fix(property-provider): re-export from @smithy/property-provider #4925

Merged
merged 1 commit into from Jul 5, 2023

Conversation

srchase
Copy link
Contributor

@srchase srchase commented Jul 5, 2023

Issue

This PR updates property-provider to re-export from @smithy/property-provider.

Description

re-exports from @smithy/property-provider so that an instanceOf check will succeed when used with a client that depends on @smithy/property-provider.

Testing

This PR addresses the issue in #4907.

After the change, the following works as-expected, with the instanceOf check correctly working to identify CredentialsProviderError.

// Version 3.363.0
import { STS } from '@aws-sdk/client-sts'
// Fixed in this PR
import { CredentialsProviderError } from '@aws-sdk/property-provider'

// In a function or in an environment with top-level async/await support
try {
  const sts = new STS({})
  await sts.getCallerIdentity({})
} catch (e: unknown) {
  if (e instanceof CredentialsProviderError) {
    console.log("Login out of date, please renew SSO session")
  } else {
    console.error("Unknown error when getting caller identity", e)
  }
}

Additional context

Add any other context about the PR here.


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@srchase srchase requested a review from a team as a code owner July 5, 2023 16:52
@trivikr trivikr changed the title fix(packages): re-export from @smithy/property-provider fix(property-provider): re-export from @smithy/property-provider Jul 5, 2023
@kuhe kuhe merged commit 0708f87 into aws:main Jul 5, 2023
3 checks passed
@srchase srchase deleted the re-export-property-provider branch July 5, 2023 17:39
@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants