summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2021-01-31 17:00:42 +0100
committermathieui <mathieui@mathieui.net>2021-01-31 17:00:42 +0100
commite9b07e32bb44464d71371eff8b93be9635777bbd (patch)
tree87f9b982938279d6e650c6b0d534884e4cb642e2
parent8689212602e29e28eb7cde000571fdbb7a437e2a (diff)
downloadslixmpp-e9b07e32bb44464d71371eff8b93be9635777bbd.tar.gz
slixmpp-e9b07e32bb44464d71371eff8b93be9635777bbd.tar.bz2
slixmpp-e9b07e32bb44464d71371eff8b93be9635777bbd.tar.xz
slixmpp-e9b07e32bb44464d71371eff8b93be9635777bbd.zip
exceptions: add a PresenceError exception
-rw-r--r--slixmpp/exceptions.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/slixmpp/exceptions.py b/slixmpp/exceptions.py
index 0486666e..5ec6e7e1 100644
--- a/slixmpp/exceptions.py
+++ b/slixmpp/exceptions.py
@@ -101,3 +101,17 @@ class IqError(XMPPError):
#: The :class:`~slixmpp.stanza.iq.Iq` error result stanza.
self.iq = iq
+
+
+class PresenceError(XMPPError):
+ """
+ An exception raised in specific circumstances for presences
+ of type 'error' received.
+ """
+ def __init__(self, pres):
+ super().__init__(
+ condition=pres['error']['condition'],
+ text=pres['error']['text'],
+ etype=pres['error']['type'],
+ )
+ self.presence = pres