From 25cf226869cbd3b36f8d1de49b7c94c2c2a81a84 Mon Sep 17 00:00:00 2001 From: kali Date: Mon, 7 Aug 2017 13:47:28 -0700 Subject: [pkg] fail gracefully if there are errors parsing logs --- src/leap/bitmask/vpn/process.py | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'src/leap/bitmask/vpn') 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 -- cgit v1.2.3