From 409a9980bd535e1ef5ba4dda8b405e02d1085904 Mon Sep 17 00:00:00 2001 From: Simon Pirkelmann Date: Sat, 24 Oct 2020 20:01:16 +0200 Subject: [PATCH] added exception for lost connection --- remote_control/robot.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/remote_control/robot.py b/remote_control/robot.py index d158147..7461202 100644 --- a/remote_control/robot.py +++ b/remote_control/robot.py @@ -1,6 +1,4 @@ import socket -import sys - class Robot: def __init__(self, marker_id, ip): @@ -34,4 +32,6 @@ class Robot: except BrokenPipeError: print(f"error: connection to robot {self.id} with ip {self.ip} lost") pass - + except ConnectionResetError: + print(f"error: connection to robot {self.id} with ip {self.ip} lost") + pass