From c0b512fe91cbdceae2f31408b19e7a4173bc572e Mon Sep 17 00:00:00 2001 From: lovetox Date: Fri, 14 Aug 2020 12:47:43 +0200 Subject: TCP: Catch Runtime error Fixes #101 --- nbxmpp/tcp.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/nbxmpp/tcp.py b/nbxmpp/tcp.py index ff91c6b..7c6b6b7 100644 --- a/nbxmpp/tcp.py +++ b/nbxmpp/tcp.py @@ -286,6 +286,13 @@ class TCPConnection(Connection): self._log.error('Write Error: %s', error) return + except RuntimeError as error: + # PyGObject raises a RuntimeError when it failed to for some reason + # to convert the GError. Why it failed to convert is printed by + # PyGObject + self._log.error(error) + return + data = data.decode() self._log_stanza(data, received=False) -- cgit v1.2.3