From b5470367a74fb09fb30dc56fe6a22254fe25d18e Mon Sep 17 00:00:00 2001 From: Ruben Pollan Date: Thu, 29 Jun 2017 13:06:19 +0200 Subject: [bug] don't raise exceptions stoping the VPN service Let's also catch the exceptions raised by stopping services so bitmaskd can stop. --- src/leap/bitmask/core/service.py | 5 ++++- src/leap/bitmask/vpn/service.py | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'src/leap') diff --git a/src/leap/bitmask/core/service.py b/src/leap/bitmask/core/service.py index 2da1ee4..6244b17 100644 --- a/src/leap/bitmask/core/service.py +++ b/src/leap/bitmask/core/service.py @@ -246,7 +246,10 @@ class BitmaskBackend(configurable.ConfigurableService): def do_stop(self): for service in self: - service.stopService() + try: + service.stopService() + except Exception as e: + log.error('Error stopping service... {0!r}'.format(e)) return self.core_commands.do_stop() # Service Toggling diff --git a/src/leap/bitmask/vpn/service.py b/src/leap/bitmask/vpn/service.py index 343a2d3..70c2624 100644 --- a/src/leap/bitmask/vpn/service.py +++ b/src/leap/bitmask/vpn/service.py @@ -67,7 +67,10 @@ class VPNService(HookableService): super(VPNService, self).startService() def stopService(self): - self.stop_vpn() + try: + self.stop_vpn() + except Exception as e: + self.log.error('Error stopping vpn service... {0!r}'.format(e)) super(VPNService, self).stopService() @defer.inlineCallbacks -- cgit v1.2.3