From 6d5ee5018a3ffdc1fc86367ff08afb20b51fc3fa Mon Sep 17 00:00:00 2001 From: chuanzgh Date: Tue, 20 Jan 2026 16:11:48 +0800 Subject: [PATCH] fix(sagemaker): Problem: In an account with multiple SageMaker Studio domains, the extension errors out if the user only have access to *some* but not *all* domains. Solution: For domains that throw exception, swallow the exceptions so that all the domains can be iterated through. --- packages/core/src/shared/clients/sagemaker.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/core/src/shared/clients/sagemaker.ts b/packages/core/src/shared/clients/sagemaker.ts index ead34d71849..79d7bef08ba 100644 --- a/packages/core/src/shared/clients/sagemaker.ts +++ b/packages/core/src/shared/clients/sagemaker.ts @@ -347,8 +347,14 @@ export class SagemakerClient extends ClientWrapper { const domains: [string, DescribeDomainResponse][] = await Promise.all( domainIds.map(async (domainId, index) => { await sleep(index * 100) - const response = await this.describeDomain({ DomainId: domainId }) - return [domainId, response] + try { + const response = await this.describeDomain({ DomainId: domainId }) + return [domainId, response] + } catch { + // Return empty response for domain IDs that error'ed out + const emptyResponse: DescribeDomainResponse = {} as DescribeDomainResponse + return [domainId, emptyResponse] + } }) )