diff options
| author | Andrej Mihajlov <and@mullvad.net> | 2017-11-30 17:39:23 +0100 |
|---|---|---|
| committer | Andrej Mihajlov <and@mullvad.net> | 2017-12-06 13:36:25 +0100 |
| commit | c4498b414838605b8864a0239fa82e0aa4eefaca (patch) | |
| tree | 414d473c15c84ebdbab1e45fdb0682b56882069b /app/lib | |
| parent | 49182dcc579235d4c45fdad2405b45993063adc8 (diff) | |
| download | mullvadvpn-c4498b414838605b8864a0239fa82e0aa4eefaca.tar.xz mullvadvpn-c4498b414838605b8864a0239fa82e0aa4eefaca.zip | |
Convert Backend.disconnect() to async
Diffstat (limited to 'app/lib')
| -rw-r--r-- | app/lib/backend.js | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/app/lib/backend.js b/app/lib/backend.js index e5b7409d12..11282f667d 100644 --- a/app/lib/backend.js +++ b/app/lib/backend.js @@ -285,15 +285,14 @@ export class Backend { } } - disconnect(): Promise<void> { + async disconnect(): Promise<void> { // @TODO: Failure modes - return this._ensureAuthenticated() - .then( () => { - return this._ipc.disconnect() - .catch(e => { - log.info('Failed to disconnect,', e.message); - }); - }); + try { + await this._ensureAuthenticated(); + await this._ipc.disconnect(); + } catch (e) { + log.error('Failed to disconnect: ', e.message); + } } shutdown(): Promise<void> { |
