changeset 29:17ab4fbce513

tmp (wokkel.mam): MAMErrow now inherit from StanzaError so it can be handler properly by services
author Goffi <goffi@goffi.org>
date Fri, 08 Jan 2016 18:52:28 +0100
parents c782fb5237f8
children 73465c020455
files wokkel/mam.py
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/wokkel/mam.py	Fri Jan 08 17:25:19 2016 +0100
+++ b/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):