exceptions: add a PresenceError exception

This commit is contained in:
mathieui 2021-01-31 17:00:42 +01:00
parent 8689212602
commit e9b07e32bb

View file

@ -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