summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/vpn/service.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/leap/bitmask/vpn/service.py')
-rw-r--r--src/leap/bitmask/vpn/service.py22
1 files changed, 8 insertions, 14 deletions
diff --git a/src/leap/bitmask/vpn/service.py b/src/leap/bitmask/vpn/service.py
index 704bbc71..2390391f 100644
--- a/src/leap/bitmask/vpn/service.py
+++ b/src/leap/bitmask/vpn/service.py
@@ -96,22 +96,16 @@ class VPNService(HookableService):
yield self._setup(domain)
- try:
- fw_ok = self._firewall.start()
- if not fw_ok:
- raise Exception('Could not start firewall')
+ fw_ok = self._firewall.start()
+ if not fw_ok:
+ raise Exception('Could not start firewall')
+ try:
vpn_ok = self._tunnel.start()
- if not vpn_ok:
- self._firewall.stop()
- raise Exception('Could not start VPN')
-
- # XXX capture it inside start method
- # here I'd like to get (status, message)
- except NoPolkitAuthAgentAvailable as e:
- e.expected = True
- raise e
- # --------------------------------------
+ except Exception as exc:
+ self._firewall.stop()
+ # TODO get message from exception
+ raise Exception('Could not start VPN (reason: %r)' % exc)
self._domain = domain
self._write_last(domain)