From 8aa4396e4490a964e3e1b1a5e6f555e97c16fd3d Mon Sep 17 00:00:00 2001 From: Lance Stout Date: Tue, 31 May 2011 12:48:43 -0700 Subject: Begin experimental use of exceptions. Provides IqTimeout and IqError which are raised when an Iq response does not arrive in time, or it arrives with type='error'. --- sleekxmpp/exceptions.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'sleekxmpp/exceptions.py') diff --git a/sleekxmpp/exceptions.py b/sleekxmpp/exceptions.py index 4727f0c6..72c0860a 100644 --- a/sleekxmpp/exceptions.py +++ b/sleekxmpp/exceptions.py @@ -52,3 +52,16 @@ class XMPPError(Exception): self.extension = extension self.extension_ns = extension_ns self.extension_args = extension_args + + +class IqTimeout(Exception): + + """ + An exception which indicates that an IQ request response has not been + received within the alloted time window. + """ + +class IqError(Exception): + + def __init__(self, iq): + self.iq = iq -- cgit v1.2.3 From 20d053807da1f59a2f7507fb7bb3845d31e27445 Mon Sep 17 00:00:00 2001 From: Lance Stout Date: Wed, 1 Jun 2011 15:28:33 -0700 Subject: IqTimeout now references the original sent stanza. A little extra bit of docs for IqError. --- sleekxmpp/exceptions.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'sleekxmpp/exceptions.py') diff --git a/sleekxmpp/exceptions.py b/sleekxmpp/exceptions.py index 72c0860a..8329a3c3 100644 --- a/sleekxmpp/exceptions.py +++ b/sleekxmpp/exceptions.py @@ -61,7 +61,15 @@ class IqTimeout(Exception): received within the alloted time window. """ + def __init__(self, iq): + self.iq = iq + class IqError(Exception): + """ + An exception raised when an Iq stanza of type 'error' is received + after making a blocking send call. + """ + def __init__(self, iq): self.iq = iq -- cgit v1.2.3