# HG changeset patch # User Goffi # Date 1452275548 -3600 # Node ID 21f0bcd3b63738f6aa434e14ec51188f1e96d753 # Parent e393b96dc553eb89eab459600aaa96ad5db029ff tmp (wokkel.mam): MAMErrow now inherit from StanzaError so it can be handler properly by services diff -r e393b96dc553 -r 21f0bcd3b637 src/tmp/wokkel/mam.py --- a/src/tmp/wokkel/mam.py Fri Jan 08 17:25:19 2016 +0100 +++ b/src/tmp/wokkel/mam.py Fri Jan 08 18:52:28 2016 +0100 @@ -33,6 +33,7 @@ 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 @@ # 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):