@@ -418,7 +418,7 @@ export class WorkspaceFolderManager {
418
418
419
419
private async checkRemoteWorkspaceStatusAndReact ( skipUploads : boolean = false ) {
420
420
this . logging . log ( `Checking remote workspace status for workspace [${ this . workspaceIdentifier } ]` )
421
- const { metadata, optOut } = await this . listWorkspaceMetadata ( this . workspaceIdentifier )
421
+ const { metadata, optOut, error } = await this . listWorkspaceMetadata ( this . workspaceIdentifier )
422
422
423
423
if ( optOut ) {
424
424
this . logging . log ( 'User opted out, clearing all resources and starting opt-out monitor' )
@@ -428,6 +428,11 @@ export class WorkspaceFolderManager {
428
428
return
429
429
}
430
430
431
+ if ( error ) {
432
+ // Do not do anything if we received an exception but not caused by optOut
433
+ return
434
+ }
435
+
431
436
if ( ! metadata ) {
432
437
// Workspace no longer exists, Recreate it.
433
438
this . resetRemoteWorkspaceId ( ) // workspaceId would change if remote record is gone
@@ -668,14 +673,17 @@ export class WorkspaceFolderManager {
668
673
private async listWorkspaceMetadata ( workspaceRoot ?: WorkspaceRoot ) : Promise < {
669
674
metadata : WorkspaceMetadata | undefined | null
670
675
optOut : boolean
676
+ error : any
671
677
} > {
672
678
let metadata : WorkspaceMetadata | undefined | null
673
679
let optOut = false
680
+ let error : any
674
681
try {
675
682
const params = workspaceRoot ? { workspaceRoot } : { }
676
683
const response = await this . serviceManager . getCodewhispererService ( ) . listWorkspaceMetadata ( params )
677
684
metadata = response && response . workspaces . length ? response . workspaces [ 0 ] : null
678
685
} catch ( e : any ) {
686
+ error = e
679
687
this . logging . warn ( `Error while fetching workspace (${ workspaceRoot } ) metadata: ${ e ?. message } ` )
680
688
if (
681
689
e ?. __type ?. includes ( 'AccessDeniedException' ) &&
@@ -685,7 +693,7 @@ export class WorkspaceFolderManager {
685
693
optOut = true
686
694
}
687
695
}
688
- return { metadata, optOut }
696
+ return { metadata, optOut, error }
689
697
}
690
698
691
699
private async createWorkspace ( workspaceRoot : WorkspaceRoot ) {
0 commit comments