Hi. I've been groaning about how Twisted loses
the actual errors, and does not allow programs
to accurately report them to the user. Here is
some progress on fixing that..
ClientFactory's connectionLost() method will get
a new parameter "reason", which will be a
failure.Failure(SomeException()). There will be
no backwards compatibility; I will fix atleast
the code in the main tree that has tests (that
succeeded before the patch!). If you want to ensure
compatibility, start using "def connectionLost(connector,
reason=None)" right now.
At a later stage, Protocol's connectionLost will get
an extra argument also, a reason as above. There
will be backwards compatibility, but having a
non-reason-taking Protocol will be deprecated from
that moment on, with a warning message.
Now, what I need from you guys is
1) review the patch
2) write TCP/Connector/ClientFactory/Protocol tests
about connectionLost (and ClientFactory.connectionFailed)
3) fix cReactor
4) fix win32eventreactor
5) fix kqreactor
6) test qtreactor
7) test gtkreactor
My current working patch is attached.