summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/vpn/service.py
diff options
context:
space:
mode:
authorKali Kaneko (leap communications) <kali@leap.se>2017-06-01 03:06:51 +0200
committerKali Kaneko (leap communications) <kali@leap.se>2017-06-01 03:33:40 +0200
commit820709938e4313e04bab160115cc215769c3a1fb (patch)
tree92adb569fc1433da6f7c1bfbc3313dfbed9a8352 /src/leap/bitmask/vpn/service.py
parent2db7202e6c3a520a5b6fe395dd74d40d8e53c481 (diff)
[refactor] improve error reporting when openvpn not found
Diffstat (limited to 'src/leap/bitmask/vpn/service.py')
-rw-r--r--src/leap/bitmask/vpn/service.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/leap/bitmask/vpn/service.py b/src/leap/bitmask/vpn/service.py
index 874c30d3..5ab1e97e 100644
--- a/src/leap/bitmask/vpn/service.py
+++ b/src/leap/bitmask/vpn/service.py
@@ -78,16 +78,24 @@ class VPNService(HookableService):
exc.expected = True
raise exc
yield self._setup(domain)
+
try:
- self._vpn.start()
+ started = self._vpn.start()
+
+ # XXX capture it inside start method
+ # here I'd like to get (status, message)
except NoPolkitAuthAgentAvailable as e:
e.expected = True
raise e
+ # --------------------------------------
- self._started = True
+ self._started = started
self._domain = domain
self._write_last(domain)
- defer.returnValue({'result': 'started'})
+ if started:
+ defer.returnValue({'result': 'started'})
+ else:
+ raise Exception('Could not start VPN, check logs')
def stop_vpn(self):
# TODO -----------------------------