catch and rethrow gaierrors in mumble.py
This commit is contained in:
parent
43a7b7d949
commit
3c7b276188
1 changed files with 5 additions and 1 deletions
|
@ -20,7 +20,11 @@ class Module(ModuleManager.BaseModule):
|
|||
timestamp = datetime.datetime.utcnow().microsecond
|
||||
ping_packet = struct.pack(">iQ", 0, timestamp)
|
||||
s = socket.socket(type=socket.SOCK_DGRAM)
|
||||
|
||||
try:
|
||||
s.sendto(ping_packet, (server, port))
|
||||
except socket.gaierror as e:
|
||||
raise utils.EventError(str(e))
|
||||
|
||||
pong_packet = s.recv(24)
|
||||
pong = struct.unpack(">bbbbQiii", pong_packet)
|
||||
|
|
Loading…
Reference in a new issue