Skip to content

Commit 9f8d2ec

Browse files
authored
fix(toolkit-lib): throw AuthenticationError instead of ExpiredToken (#736)
We own the `AuthenticationError` while `ExpiredToken` comes directly from the SDKs. --- By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license
1 parent 45ceb89 commit 9f8d2ec

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/@aws-cdk/toolkit-lib/lib/api/aws-auth/sdk-provider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ export class SdkProvider {
182182
return { sdk, didAssumeRole: true };
183183
} catch (err: any) {
184184
if (err.name === 'ExpiredToken') {
185-
throw err;
185+
throw AuthenticationError.withCause('Assuming role failed: ExpiredToken', err);
186186
}
187187

188188
// AssumeRole failed. Proceed and warn *if and only if* the baseCredentials were already for the right account

0 commit comments

Comments
 (0)