summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorkali <kali@leap.se>2017-08-07 13:47:28 -0700
committerKali Kaneko <kali@leap.se>2017-08-14 18:09:57 -0400
commit25cf226869cbd3b36f8d1de49b7c94c2c2a81a84 (patch)
tree703267479b28c61d706aa56a5a7248dfe2d75936 /src
parentc035917e5318ac494c8b9e7d9fdf09ddcb424006 (diff)
[pkg] fail gracefully if there are errors parsing logs
Diffstat (limited to 'src')
-rw-r--r--src/leap/bitmask/vpn/process.py19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/leap/bitmask/vpn/process.py b/src/leap/bitmask/vpn/process.py
index aaf990c1..8506eb61 100644
--- a/src/leap/bitmask/vpn/process.py
+++ b/src/leap/bitmask/vpn/process.py
@@ -178,20 +178,29 @@ class _VPNProcess(protocol.ProcessProtocol):
Polls connection status.
"""
if self._alive:
- up, down = self._management.get_traffic_status()
- self._status.set_traffic_status(up, down)
+ try:
+ up, down = self._management.get_traffic_status()
+ self._status.set_traffic_status(up, down)
+ except Exception:
+ self.log.debug('Could not parse traffic status')
def pollState(self):
"""
Polls connection state.
"""
if self._alive:
- state = self._management.get_state()
- self._status.set_status(state, None)
+ try:
+ state = self._management.get_state()
+ self._status.set_status(state, None)
+ except Exception:
+ self.log.debug('Could not parse connection state')
def pollLog(self):
if self._alive:
- self._management.process_log()
+ try:
+ self._management.process_log()
+ except Exception:
+ self.log.debug('Could not parse log')
# launcher