diff options
| author | Andrej Mihajlov <and@mullvad.net> | 2018-07-10 13:32:29 +0200 |
|---|---|---|
| committer | Andrej Mihajlov <and@mullvad.net> | 2018-07-16 10:55:06 +0200 |
| commit | 57ebb751e0f1929a3c7bdf2875e165478dbad3b0 (patch) | |
| tree | e0482adbd4c743c10d4dd391f050d06e322d6196 | |
| parent | 3d5dead8f035bbb37c09edfea37d715b1218adc9 (diff) | |
| download | mullvadvpn-57ebb751e0f1929a3c7bdf2875e165478dbad3b0.tar.xz mullvadvpn-57ebb751e0f1929a3c7bdf2875e165478dbad3b0.zip | |
Handle promise rejection coming from connectTunnel()
| -rw-r--r-- | app/app.js | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/app/app.js b/app/app.js index 3beab7a810..187c0a7fef 100644 --- a/app/app.js +++ b/app/app.js @@ -133,10 +133,15 @@ export default class AppRenderer { // Redirect the user after some time to allow for // the 'Login Successful' screen to be visible - setTimeout(() => { + setTimeout(async () => { actions.history.push('/connect'); - log.debug('Autoconnecting...'); - this.connectTunnel(); + + try { + log.debug('Auto-connecting the tunnel...'); + await this.connectTunnel(); + } catch (error) { + log.error(`Failed to auto-connect the tunnel: ${error.message}`); + } }, 1000); } catch (error) { log.error('Failed to log in,', error.message); |
