Antoine Pitrou <solipsis <at> pitrou.net> writes:

> 
> On Wed, 08 Dec 2010 11:48:16 +0100
> Georg Brandl <g.brandl <at> gmx.net> wrote:
  But hopefully standard
> > library modules don't use it to report exceptions to code that uses them?
> 
> I'm not aware of that, but there are certainly third-party libs using
> it (think an HTTP server that wants to log an error in one of its
> request handlers without the error taking the whole server down).
> 

That's not the same thing as Georg is talking about, IIUC. The exception()
method is used in exception *handler* code to record that the exception
occurred, but the correct thing for any code to do when an error condition is
detected (in most situations at least) is to raise an exception. It would be
quite wrong for code to e.g. call logger.error(...) instead of raise ...

Regards,

Vinay Sajip

_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to