File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -435,18 +435,19 @@ export class AtelierAPI {
435
435
436
436
return data ;
437
437
} catch ( error ) {
438
- if ( error . code === "ECONNREFUSED" ) {
439
- authRequestMap . delete ( target ) ;
438
+ // always discard the cached authentication promise
439
+ authRequestMap . delete ( target ) ;
440
+
441
+ // In some cases schedule an automatic retry.
442
+ // ENOTFOUND occurs if, say, the VPN to the server's network goes down.
443
+ if ( error . code === "ECONNREFUSED" || error . code === "ENOTFOUND" ) {
440
444
panel . text = `${ this . connInfo } $(debug-disconnect)` ;
441
445
panel . tooltip = "Disconnected" ;
442
446
workspaceState . update ( this . configName . toLowerCase ( ) + ":host" , undefined ) ;
443
447
workspaceState . update ( this . configName . toLowerCase ( ) + ":port" , undefined ) ;
444
448
if ( ! checkingConnection ) {
445
449
setTimeout ( ( ) => checkConnection ( false , undefined , true ) , 30000 ) ;
446
450
}
447
- } else if ( error . code === "EPROTO" ) {
448
- // This can happen if https was configured but didn't work
449
- authRequestMap . delete ( target ) ;
450
451
}
451
452
throw error ;
452
453
}
You can’t perform that action at this time.
0 commit comments