From 6297b5abfdb113a0716f4adf82b7660aa0203f40 Mon Sep 17 00:00:00 2001 From: Stefan Midjich Date: Fri, 29 Sep 2017 19:11:35 +0200 Subject: [PATCH] try with exception --- tools/client.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tools/client.py b/tools/client.py index ae99855..63f1601 100644 --- a/tools/client.py +++ b/tools/client.py @@ -69,14 +69,15 @@ class Client(object): # count. Don't rely on it existing though. rule = None try: - rule = self.find_rule(self.ip_address, self.protocol) + rule = self.find_rule(self._ip_address, self.protocol) except Exception as e: # TODO: This should raise an exception and be handled further up # the stack by logging the error. - #raise IPTCRuleNotFound('Could not find the iptables rule for {client_ip}'.format( - # client_ip=self.ip_address - #)) - return None + raise IPTCRuleNotFound( + 'Could not find the iptables rule for {client_ip}'.format( + client_ip=self.ip_address + ) + ) if rule: (packet_count, byte_count) = rule.get_counters()