summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2011-06-01 15:28:33 -0700
committerLance Stout <lancestout@gmail.com>2011-06-01 15:28:33 -0700
commit20d053807da1f59a2f7507fb7bb3845d31e27445 (patch)
tree0e31acee8ecc5c8649b2621aa7fc0f2631f03066
parent8aa4396e4490a964e3e1b1a5e6f555e97c16fd3d (diff)
downloadslixmpp-20d053807da1f59a2f7507fb7bb3845d31e27445.tar.gz
slixmpp-20d053807da1f59a2f7507fb7bb3845d31e27445.tar.bz2
slixmpp-20d053807da1f59a2f7507fb7bb3845d31e27445.tar.xz
slixmpp-20d053807da1f59a2f7507fb7bb3845d31e27445.zip
IqTimeout now references the original sent stanza.
A little extra bit of docs for IqError.
-rw-r--r--sleekxmpp/exceptions.py8
-rw-r--r--sleekxmpp/stanza/iq.py2
2 files changed, 9 insertions, 1 deletions
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
diff --git a/sleekxmpp/stanza/iq.py b/sleekxmpp/stanza/iq.py
index 71419bc4..f05dad17 100644
--- a/sleekxmpp/stanza/iq.py
+++ b/sleekxmpp/stanza/iq.py
@@ -200,7 +200,7 @@ class Iq(RootStanza):
StanzaBase.send(self, now=now)
result = waitfor.wait(timeout)
if not result:
- raise IqTimeout()
+ raise IqTimeout(self)
if result['type'] == 'error':
raise IqError(result)
return result