diff options
| author | Oskar Nyberg <oskar@mullvad.net> | 2021-11-17 10:53:36 +0100 |
|---|---|---|
| committer | Oskar Nyberg <oskar@mullvad.net> | 2021-11-17 16:26:49 +0100 |
| commit | 9fe486c7791dc3cc99d989c9566363e65d85e651 (patch) | |
| tree | a5f0c0d48fce732020914fb8a5ab9fce82832503 | |
| parent | 77fb350c5c571d8d97cdd6078b2b82f8ae1c24c1 (diff) | |
| download | mullvadvpn-9fe486c7791dc3cc99d989c9566363e65d85e651.tar.xz mullvadvpn-9fe486c7791dc3cc99d989c9566363e65d85e651.zip | |
Rename recoverFromBootstrapError
| -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); } |
