Commit 6e0399b5 authored by Philipp Hörist's avatar Philipp Hörist

Task: Display timeout error

parent c2e09adc
Pipeline #6692 passed with stages
in 53 seconds
......@@ -27,6 +27,10 @@ def is_error(error):
class BaseError(Exception):
def __init__(self, is_fatal=False):
self.is_fatal = is_fatal
self.text = ''
def __str__(self):
return self.text
class StanzaError(BaseError):
......@@ -141,9 +145,9 @@ class TimeoutStanzaError(BaseError):
log_level = logging.INFO
def __init__(self, id_):
BaseError.__init__(self, is_fatal=True)
self.text = 'IQ with id %s reached timeout' % id_
def __init__(self):
BaseError.__init__(self)
self.text = 'Timeout reached'
class RegisterStanzaError(StanzaError):
......
......@@ -309,7 +309,7 @@ class IqRequestTask(Task):
return
if result is None:
self._error = TimeoutStanzaError(self._iq_id)
self._error = TimeoutStanzaError()
self._set_finished()
return
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment