tmp (wokkel.mam): MAMErrow now inherit from StanzaError so it can be handler properly by services

This commit is contained in:
Goffi 2016-01-08 18:52:28 +01:00
commit e6a8b8ac85

View file

@ -33,6 +33,7 @@ from zope.interface import Interface
from twisted.words.protocols.jabber import xmlstream
from twisted.words.xish import domish
from twisted.words.protocols.jabber import jid
from twisted.words.protocols.jabber import error
from twisted.internet import defer
from twisted.python import log
@ -53,10 +54,14 @@ PREFS_SET_REQUEST = "/iq[@type='set']/prefs[@xmlns='%s']" % NS_MAM
# TODO: add the tests!
class MAMError(Exception):
class MAMError(error.StanzaError):
"""
MAM error.
"""
def __init__(self, text=None):
error.StanzaError.__init__(self, 'bad-request', text=text)
class Unsupported(MAMError):
def __init__(self, feature, text=None):