summaryrefslogtreecommitdiffhomepage
path: root/app
diff options
context:
space:
mode:
authorAndrej Mihajlov <and@mullvad.net>2017-11-30 17:39:23 +0100
committerAndrej Mihajlov <and@mullvad.net>2017-12-06 13:36:25 +0100
commitc4498b414838605b8864a0239fa82e0aa4eefaca (patch)
tree414d473c15c84ebdbab1e45fdb0682b56882069b /app
parent49182dcc579235d4c45fdad2405b45993063adc8 (diff)
downloadmullvadvpn-c4498b414838605b8864a0239fa82e0aa4eefaca.tar.xz
mullvadvpn-c4498b414838605b8864a0239fa82e0aa4eefaca.zip
Convert Backend.disconnect() to async
Diffstat (limited to 'app')
-rw-r--r--app/lib/backend.js15
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> {