fix: handling exceptions when bettercap is not running yet
This commit is contained in:
parent
5cb721f490
commit
90998be24c
@ -307,6 +307,8 @@ class Agent(Client, AsyncAdvertiser, AsyncTrainer):
|
|||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
|
|
||||||
new_shakes = 0
|
new_shakes = 0
|
||||||
|
|
||||||
|
try:
|
||||||
s = self.session()
|
s = self.session()
|
||||||
self._update_uptime(s)
|
self._update_uptime(s)
|
||||||
|
|
||||||
@ -314,7 +316,6 @@ class Agent(Client, AsyncAdvertiser, AsyncTrainer):
|
|||||||
self._update_peers()
|
self._update_peers()
|
||||||
self._update_counters()
|
self._update_counters()
|
||||||
|
|
||||||
try:
|
|
||||||
for h in [e for e in self.events() if e['tag'] == 'wifi.client.handshake']:
|
for h in [e for e in self.events() if e['tag'] == 'wifi.client.handshake']:
|
||||||
filename = h['data']['file']
|
filename = h['data']['file']
|
||||||
sta_mac = h['data']['station']
|
sta_mac = h['data']['station']
|
||||||
@ -340,7 +341,7 @@ class Agent(Client, AsyncAdvertiser, AsyncTrainer):
|
|||||||
plugins.on('handshake', self, filename, ap, sta)
|
plugins.on('handshake', self, filename, ap, sta)
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logging.exception("error")
|
logging.error("error: %s" % e)
|
||||||
|
|
||||||
finally:
|
finally:
|
||||||
self._update_handshakes(new_shakes)
|
self._update_handshakes(new_shakes)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user