IqTimeout now references the original sent stanza.

A little extra bit of docs for IqError.
This commit is contained in:
Lance Stout 2011-06-01 15:28:33 -07:00
parent 8aa4396e44
commit 20d053807d
2 changed files with 9 additions and 1 deletions

View file

@ -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

View file

@ -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