diff options
Diffstat (limited to 'gui/src')
| -rw-r--r-- | gui/src/main/index.ts | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/gui/src/main/index.ts b/gui/src/main/index.ts index 6db9ebb8d7..3e8a7a34ee 100644 --- a/gui/src/main/index.ts +++ b/gui/src/main/index.ts @@ -568,7 +568,7 @@ class ApplicationMain { const error = e as Error; log.error(`Failed to subscribe: ${error.message}`); - return this.recoverFromBootstrapError(error); + return this.handleBootstrapError(error); } // fetch account history @@ -578,7 +578,7 @@ class ApplicationMain { const error = e as Error; log.error(`Failed to fetch the account history: ${error.message}`); - return this.recoverFromBootstrapError(error); + return this.handleBootstrapError(error); } // fetch the tunnel state @@ -588,7 +588,7 @@ class ApplicationMain { const error = e as Error; log.error(`Failed to fetch the tunnel state: ${error.message}`); - return this.recoverFromBootstrapError(error); + return this.handleBootstrapError(error); } // fetch settings @@ -598,7 +598,7 @@ class ApplicationMain { const error = e as Error; log.error(`Failed to fetch settings: ${error.message}`); - return this.recoverFromBootstrapError(error); + return this.handleBootstrapError(error); } if (this.tunnelStateExpectation) { @@ -616,7 +616,7 @@ class ApplicationMain { const error = e as Error; log.error(`Failed to fetch relay locations: ${error.message}`); - return this.recoverFromBootstrapError(error); + return this.handleBootstrapError(error); } // fetch the daemon's version @@ -626,7 +626,7 @@ class ApplicationMain { const error = e as Error; log.error(`Failed to fetch the daemon's version: ${error.message}`); - return this.recoverFromBootstrapError(error); + return this.handleBootstrapError(error); } // fetch the latest version info in background @@ -698,9 +698,8 @@ class ApplicationMain { .catch((error) => log.error(`Unable to connect to daemon: ${error.message}`)); } - private recoverFromBootstrapError(_error?: Error) { - // Attempt to reconnect to daemon if the program fails to fetch settings, tunnel state or - // subscribe for RPC events. + private handleBootstrapError(_error?: Error) { + // Unsubscribe from daemon events when encountering errors during initial data retrieval. if (this.daemonEventListener) { this.daemonRpc.unsubscribeDaemonEventListener(this.daemonEventListener); } |
