Skip to content

Commit 2eb37d4

Browse files
committed
fix(sagemaker): fix sagemaker.parseCookies cmd not found
1 parent bccb5a1 commit 2eb37d4

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

packages/core/src/auth/activation.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,22 @@ import { LoginManager } from './deprecated/loginManager'
99
import { fromString } from './providers/credentials'
1010
import { initializeCredentialsProviderManager } from './utils'
1111
import { isAmazonQ, isSageMaker } from '../shared/extensionUtilities'
12+
import { getLogger } from '../shared/logger/logger'
1213

1314
interface SagemakerCookie {
1415
authMode?: 'Sso' | 'Iam'
1516
}
1617

1718
export async function initialize(loginManager: LoginManager): Promise<void> {
1819
if (isAmazonQ() && isSageMaker()) {
19-
// The command `sagemaker.parseCookies` is registered in VS Code Sagemaker environment.
20-
const result = (await vscode.commands.executeCommand('sagemaker.parseCookies')) as SagemakerCookie
21-
if (result.authMode !== 'Sso') {
22-
initializeCredentialsProviderManager()
20+
try {
21+
// The command `sagemaker.parseCookies` is registered in VS Code Sagemaker environment.
22+
const result = (await vscode.commands.executeCommand('sagemaker.parseCookies')) as SagemakerCookie
23+
if (result.authMode !== 'Sso') {
24+
initializeCredentialsProviderManager()
25+
}
26+
} catch (e) {
27+
getLogger().warn(`Failed to execute command "sagemaker.parseCookies": ${e}`)
2328
}
2429
}
2530
Auth.instance.onDidChangeActiveConnection(async (conn) => {

0 commit comments

Comments
 (0)