diff --git a/telnetserver/telnetserver.py b/telnetserver/telnetserver.py index 0ba3ec2..06da362 100644 --- a/telnetserver/telnetserver.py +++ b/telnetserver/telnetserver.py @@ -123,13 +123,19 @@ class TelnetServer: except asyncio.CancelledError: pass + except (TimeoutError, ConnectionResetError): + logger.debug("Telnet client connection timed out or was reset by client") except Exception: logger.exception("Exception handling telnet client") finally: logger.debug("Telnet client disconnected") self._clients.remove(writer) - writer.close() - await writer.wait_closed() + try: + writer.close() + await writer.wait_closed() + except (TimeoutError, ConnectionResetError, OSError): + # Socket already closed or timed out, don't care as we were getting rid of it anyway + pass def stop(self): """Stops the telnet server""" diff --git a/templates/add_spot.html b/templates/add_spot.html index 93066c0..0ce2af2 100644 --- a/templates/add_spot.html +++ b/templates/add_spot.html @@ -77,7 +77,7 @@ - + diff --git a/templates/alerts.html b/templates/alerts.html index 885f236..2eb1a07 100644 --- a/templates/alerts.html +++ b/templates/alerts.html @@ -85,7 +85,7 @@ - + diff --git a/templates/bands.html b/templates/bands.html index 4d81c6e..42b68fe 100644 --- a/templates/bands.html +++ b/templates/bands.html @@ -76,8 +76,8 @@ - - + + diff --git a/templates/base.html b/templates/base.html index 8c917d2..f302c60 100644 --- a/templates/base.html +++ b/templates/base.html @@ -1,6 +1,6 @@ {% extends "skeleton.html" %} {% block head_extra %} - + @@ -16,10 +16,10 @@ window.fetchEventSource = fetchEventSource; - - - - + + + + {% end %} {% block body %}