added exception for lost connection

This commit is contained in:
Simon Pirkelmann 2020-10-24 20:01:16 +02:00
parent 9e1ce9b512
commit 409a9980bd

View File

@ -1,6 +1,4 @@
import socket import socket
import sys
class Robot: class Robot:
def __init__(self, marker_id, ip): def __init__(self, marker_id, ip):
@ -34,4 +32,6 @@ class Robot:
except BrokenPipeError: except BrokenPipeError:
print(f"error: connection to robot {self.id} with ip {self.ip} lost") print(f"error: connection to robot {self.id} with ip {self.ip} lost")
pass pass
except ConnectionResetError:
print(f"error: connection to robot {self.id} with ip {self.ip} lost")
pass