diff options
author | mathieui <mathieui@mathieui.net> | 2022-04-05 20:15:49 +0200 |
---|---|---|
committer | mathieui <mathieui@mathieui.net> | 2022-04-05 20:15:49 +0200 |
commit | 8bac7440093790a35275108ae52abefbe52f4995 (patch) | |
tree | 35f34095c6c716982450cbb3b5481489e75afb99 | |
parent | f7902d056ec995f7f373df4c865d644fa2d0bbfd (diff) | |
parent | 88d2f5dae4866369be33c34c7d8bbf252ead3414 (diff) | |
download | slixmpp-8bac7440093790a35275108ae52abefbe52f4995.tar.gz slixmpp-8bac7440093790a35275108ae52abefbe52f4995.tar.bz2 slixmpp-8bac7440093790a35275108ae52abefbe52f4995.tar.xz slixmpp-8bac7440093790a35275108ae52abefbe52f4995.zip |
Merge branch 'starttls-exception' into 'master'
features_starttls/Proceed: raise exception on InvalidCABundle
See merge request poezio/slixmpp!196
-rw-r--r-- | slixmpp/features/feature_starttls/stanza.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/slixmpp/features/feature_starttls/stanza.py b/slixmpp/features/feature_starttls/stanza.py index 70979402..f433f1b2 100644 --- a/slixmpp/features/feature_starttls/stanza.py +++ b/slixmpp/features/feature_starttls/stanza.py @@ -3,8 +3,12 @@ # Copyright (C) 2011 Nathanael C. Fritz # This file is part of Slixmpp. # See the file LICENSE for copying permission. -from slixmpp.xmlstream import StanzaBase, ElementBase from typing import Set, ClassVar +from slixmpp.xmlstream import StanzaBase, ElementBase +from slixmpp.xmlstream.xmlstream import InvalidCABundle + +import logging +log = logging.getLogger(__name__) class STARTTLS(StanzaBase): @@ -36,6 +40,12 @@ class Proceed(StanzaBase): namespace = 'urn:ietf:params:xml:ns:xmpp-tls' interfaces: ClassVar[Set[str]] = set() + def exception(self, e: Exception) -> None: + log.exception('Error handling {%s}%s stanza', + self.namespace, self.name) + if isinstance(e, InvalidCABundle): + raise e + class Failure(StanzaBase): """ |