diff options
| author | Andrej Mihajlov <and@mullvad.net> | 2017-11-30 17:39:42 +0100 |
|---|---|---|
| committer | Andrej Mihajlov <and@mullvad.net> | 2017-12-06 13:36:25 +0100 |
| commit | 6103b98626e4b2292b8ba96134df545003c4c2a3 (patch) | |
| tree | 057c457427f6f0e5859b7dc8683f3665a08be12b /app | |
| parent | c4498b414838605b8864a0239fa82e0aa4eefaca (diff) | |
| download | mullvadvpn-6103b98626e4b2292b8ba96134df545003c4c2a3.tar.xz mullvadvpn-6103b98626e4b2292b8ba96134df545003c4c2a3.zip | |
Convert Backend.shutdown() to async
Diffstat (limited to 'app')
| -rw-r--r-- | app/lib/backend.js | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/app/lib/backend.js b/app/lib/backend.js index 11282f667d..daba566254 100644 --- a/app/lib/backend.js +++ b/app/lib/backend.js @@ -295,11 +295,13 @@ export class Backend { } } - shutdown(): Promise<void> { - return this._ensureAuthenticated() - .then( () => { - return this._ipc.shutdown(); - }); + async shutdown(): Promise<void> { + try { + await this._ensureAuthenticated(); + await this._ipc.shutdown(); + } catch (e) { + log.error('Failed to shutdown: ', e.message); + } } updateRelaySettings(relaySettings: RelaySettingsUpdate): Promise<void> { |
