Philipp Hörist pushed to branch master at gajim / python-nbxmpp
Commits:
47e73f72 by Philipp Hörist at 2019-11-17T18:55:48Z
Handle malformed error stanzas
Fixes #89
- - - - -
1 changed file:
- nbxmpp/util.py
Changes:
=====================================
nbxmpp/util.py
=====================================
@@ -152,9 +152,15 @@ def raise_error(log_method, stanza, condition=None,
text=None):
if log_method.__name__ not in ('warning', 'error'):
log_method = log_method.__self__.warning
- error = error_factory(stanza, condition, text)
- log_method(error)
+ try:
+ error = error_factory(stanza, condition, text)
+ except Exception:
+ log.exception('Malformed error stanza')
+ log.error(stanza)
+ error = StanzaMalformedError(stanza, text)
+ return error
+ log_method(error)
if log_method.__name__ in ('warning', 'error'):
log_method(stanza)
return error
View it on GitLab:
https://dev.gajim.org/gajim/python-nbxmpp/commit/47e73f72b00418645606c496315ad2c51eb04b44
--
View it on GitLab:
https://dev.gajim.org/gajim/python-nbxmpp/commit/47e73f72b00418645606c496315ad2c51eb04b44
You're receiving this email because of your account on dev.gajim.org.
_______________________________________________
Commits mailing list
[email protected]
https://lists.gajim.org/cgi-bin/listinfo/commits