[Twisted-Python] newbie question: error handling

Ivo van der Wijk ivo at amaze.nl
Sun Dec 30 18:44:31 EST 2001

Hi All,

I'm currently migrating my irc client to twisted, and things look

However, I can't figure out the following things:

My protocol is derived from protocols.basic.LineReceiver
(which in turn derives from protocol.Protocol.protocol).

How can I determine what specific error condition caused connectionLost()
or connectionFailed()? I.e. connection refused, unknown hostname,
no route to host, etc (the standard errno stuff). 

Also, how can I determine if Linereceived.sendLine() (or 
Protocol.Transport.write()) failed? It doesn't seem to return an
error value or raise Exceptions, and depending on the invocation
of connectionLost makes things perhaps too asynchronous..



Drs. I.R. van der Wijk                              -=-
Brouwersgracht 132                      Amaze Internet Services V.O.F.
1013 HA Amsterdam, NL                               -=-
Tel: +31-20-4688336                       Linux/Web/Zope/SQL/MMBase
Fax: +31-20-4688337                           Network Solutions
Web:     http://www.amaze.nl/                    Consultancy
Email:   ivo at amaze.nl                               -=-

More information about the Twisted-Python mailing list