Skip to content

Commit 1cd7745

Browse files
committed
Fix error statements
1 parent 84f8310 commit 1cd7745

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

packages/amazonq/src/extensionNode.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ async function activateAmazonQNode(context: vscode.ExtensionContext) {
100100
async function getAuthState(): Promise<Omit<AuthUserState, 'source'>> {
101101
const state = AuthUtil.instance.getAuthState()
102102

103-
if (AuthUtil.instance.isConnected() && !(AuthUtil.instance.isSsoSession() || isSageMaker())) {
104-
getLogger().error('Current Amazon Q connection is not SSO')
103+
if (AuthUtil.instance.isConnected() && !(AuthUtil.instance.isSsoSession() || AuthUtil.instance.isIamSession() || isSageMaker())) {
104+
getLogger().error('Current Amazon Q connection is not SSO nor IAM')
105105
}
106106

107107
return {

packages/core/src/login/webview/vue/amazonq/backend_amazonq.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,8 @@ export class AmazonQLoginWebview extends CommonAuthWebview {
209209
await AuthUtil.instance.login_iam(accessKey, secretKey, sessionToken, roleArn)
210210
} catch (e) {
211211
getLogger().error('Failed submitting credentials %O', e)
212-
return { id: this.id, text: e as string }
212+
const message = e instanceof Error ? e.message : e as string
213+
return { id: this.id, text: message }
213214
}
214215
// Enable code suggestions
215216
vsCodeState.isFreeTierLimitReached = false

packages/core/src/shared/featureConfig.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ export class FeatureConfigProvider {
118118
}
119119

120120
async fetchFeatureConfigs(): Promise<void> {
121-
if (AuthUtil.instance.isConnectionExpired()) {
121+
if (AuthUtil.instance.isConnectionExpired() || AuthUtil.instance.isIamSession()) {
122122
return
123123
}
124124

0 commit comments

Comments
 (0)