File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
packages/core/src/codewhisperer/region Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -177,9 +177,17 @@ export class RegionProfileManager {
177177 }
178178 }
179179
180- // Only throw error if all regions fail
181- if ( failedRegions . length === endpoints . size ) {
182- throw new Error ( `Failed to list profiles for all regions: ${ failedRegions . join ( ', ' ) } ` )
180+ // Throw error if any regional API calls failed and no profiles are available
181+ if ( failedRegions . length > 0 && availableProfiles . length === 0 ) {
182+ throw new ToolkitError ( `Failed to list Q Developer profiles for regions: ${ failedRegions . join ( ', ' ) } ` , {
183+ code : 'ListQDeveloperProfilesFailed' ,
184+ } )
185+ }
186+
187+ // Throw an error if all listAvailableProfile calls succeeded, but user has no Q developer profiles
188+ // This is not an expected state
189+ if ( failedRegions . length === 0 && availableProfiles . length === 0 ) {
190+ throw new ToolkitError ( 'This user has no Q Developer profiles' , { code : 'QDeveloperProfileNotFound' } )
183191 }
184192
185193 this . _profiles = availableProfiles
You can’t perform that action at this time.
0 commit comments