summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/vpn/_control.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/leap/bitmask/vpn/_control.py')
-rw-r--r--src/leap/bitmask/vpn/_control.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/leap/bitmask/vpn/_control.py b/src/leap/bitmask/vpn/_control.py
index a57c6e47..7f80f40b 100644
--- a/src/leap/bitmask/vpn/_control.py
+++ b/src/leap/bitmask/vpn/_control.py
@@ -66,17 +66,23 @@ class VPNControl(object):
vpnproc.preUp()
except Exception as e:
self.log.error('Error on vpn pre-up {0!r}'.format(e))
- raise
+ return False
try:
cmd = vpnproc.getCommand()
except Exception as e:
self.log.error(
'Error while getting vpn command... {0!r}'.format(e))
- raise
+ return False
env = os.environ
- runningproc = reactor.spawnProcess(vpnproc, cmd[0], cmd, env)
+ try:
+ runningproc = reactor.spawnProcess(vpnproc, cmd[0], cmd, env)
+ except Exception as e:
+ self.log.error(
+ 'Error while spwanning vpn process... {0!r}'.format(e))
+ return False
+
vpnproc.pid = runningproc.pid
self._vpnproc = vpnproc