Re: giving a reason when adding a timeout
Adi Roiban <[email protected]> Wed, 13 Mar 2019 12:24:58 +0000
| Newsgroups | gmane.comp.python.twisted |
|---|---|
| Message-ID | <CAFycZ9fm4XDkoHw=_XOEOtgk0dxsJL-kQ20NP47Dztxamgr7rw@mail.gmail.com> |
Hi, On Wed, 13 Mar 2019 at 11:21, Chris Withers <[email protected]> wrote: > > Hi All, > > Unless I'm missing something, Deferred.addTimeout is really unhelpful in > terms on providing context about *what* timed out. > TimeoutError(<some number>, 'Deferred') just isn't that useful. > > How come addTimeout doesn't let you specify a textual reason, or > otherwise provide some context about the timeout? > > Am I missing something obvious here? I don't know what kind of context do you need :) You can add your own errback and add your extra error handling there. There is also onTimeoutCancel argument. If there is anything missing from the API, feel free to send a pull request in GitHub. I guess that it was implemented in this way as the current implementation serves the purpose for the people who have added the support for timeout. Regards, Adi > Chris > > _______________________________________________ > Twisted-Python mailing list > [email protected] > https://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python -- Adi Roiban _______________________________________________ Twisted-Python mailing list [email protected] https://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python