diff options
author | lovetox <philipp@hoerist.com> | 2020-09-25 18:09:34 +0300 |
---|---|---|
committer | lovetox <philipp@hoerist.com> | 2020-09-25 18:09:34 +0300 |
commit | aa7791fe3faff1ebe1e205faba7d93a268647afd (patch) | |
tree | 86212b6cf3dcbcafe09f64aa2b8ba09acc603998 /nbxmpp | |
parent | 29212faaaa0472960770553b3b06d20d067689c8 (diff) |
TCP: Catch RuntimeError also on _on_read_async_finish()
Diffstat (limited to 'nbxmpp')
-rw-r--r-- | nbxmpp/tcp.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/nbxmpp/tcp.py b/nbxmpp/tcp.py index e661a8c..f39da27 100644 --- a/nbxmpp/tcp.py +++ b/nbxmpp/tcp.py @@ -226,6 +226,12 @@ class TCPConnection(Connection): self._finalize('disconnected') return + except RuntimeError as error: + # PyGObject raises a RuntimeError when it fails to convert the + # GError. Why it failed is printed by PyGObject + self._log.error(error) + return + data = data.get_data() if not data: if self._state == TCPState.DISCONNECTING: @@ -287,9 +293,8 @@ class TCPConnection(Connection): 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 + # PyGObject raises a RuntimeError when it fails to convert the + # GError. Why it failed is printed by PyGObject self._log.error(error) return |