changeset 1784:21f0bcd3b637

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 e393b96dc553
children ac73d7456abc
files src/tmp/wokkel/mam.py
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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):