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 {
435435
436436 return data;
437437 } 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") {
440444 panel.text = `${this.connInfo} $(debug-disconnect)`;
441445 panel.tooltip = "Disconnected";
442446 workspaceState.update(this.configName.toLowerCase() + ":host", undefined);
443447 workspaceState.update(this.configName.toLowerCase() + ":port", undefined);
444448 if (!checkingConnection) {
445449 setTimeout(() => checkConnection(false, undefined, true), 30000);
446450 }
447- } else if (error.code === "EPROTO") {
448- // This can happen if https was configured but didn't work
449- authRequestMap.delete(target);
450451 }
451452 throw error;
452453 }
You can’t perform that action at this time.
0 commit comments