Commit 47e73f72 authored by Philipp Hörist's avatar Philipp Hörist

Handle malformed error stanzas

Fixes #89
parent 1a844d50
Pipeline #4587 passed with stages
in 23 seconds
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment