[Twisted-Python] TimeoutError in BaseConnector

Duncan McGreggor duncan.mcgreggor at gmail.com
Sat Jan 21 20:09:56 EST 2006


Hey all,

I have an issue with the following in t.i.base.BaseConnector:

if self.timeout is not None:
     self.timeoutID = self.reactor.callLater(self.timeout,
         transport.failIfNotConnected, error.TimeoutError())


Might it be more useful and less misleading to describe this a little 
more? I was quite perplexed at an unexpected timeout error, until I 
realized it was being generated by the connector. I kept getting this 
message:

   User timeout caused connection failure.

While technically true, I was mislead but the "User timeout" bit, and 
it took me a while to get my bearings, quit futzing with the factory 
and protocol settings, and track this down. I made the following change 
in my local t.i.base:

if self.timeout is not None:
     self.timeoutID = self.reactor.callLater(self.timeout,
         transport.failIfNotConnected,
         error.TimeoutError("Could not connect after %s seconds" % 
self.timeout))

This results in the less cryptic:

"User timeout caused connection failure: Could not connect after 30 
seconds."

Shall I submit a patch in trac?

Thanks,

d





More information about the Twisted-Python mailing list