[Twisted-Python] Need Exception that will stop ther reactor within twistd

Nicolas D. Cesar ncesar at lunix.com.ar
Fri Nov 24 19:55:43 EST 2006


El Viernes, 24 de Noviembre de 2006 20:18, glyph at divmod.com escribió:
> So make GoodByeException.__init__ call reactor.stop() instead of setting
> the useless 'args' attribute.

Must admit, is a clever idea... :-D

> This is bad form, however.  Particular types of exception should not stop
> the reactor.  Code that wants the reactor to stop, should call
> reactor.stop.  Maybe you could make a method that both calls reactor.stop()
> *and* raises an exception.

This is the way i'm doing it right now, but i'm starting to detect new 
exceptions raised within standard library (among others) code... and instead 
of catching all posibilities I wanted the application to quit (with the 
corresponding logging done).

I was wondering if twistd/the application class could have a "exit on 
Exception" for this type of operations.

As always, Thanks  glyph for the advice
-- 
Nicolás D. César <ncesar at lunix.com.ar>
Lunix S.R.L. -[ http://www.lunix.com.ar ]-
GnuPG Public Key: gpg --keyserver wwwkeys.pgp.net --recv-key 0x3606F3E6
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://twistedmatrix.com/pipermail/twisted-python/attachments/20061124/f23164c9/attachment.pgp 


More information about the Twisted-Python mailing list