Overuse of try/except/else?

James Mills prologic at shortcircuit.net.au
Tue May 10 23:37:57 EDT 2011


On Tue, May 10, 2011 at 7:34 PM, Jean-Michel Pichavant
<jeanmichel at sequans.com> wrote:
> You can reraise the exception without loosing the stack trace.
>
> try:
> ...
> except SomeException, exc:
> log(exc)
> print 'Hello world'
> raise # "raise exc" would loose the original stack trace

Valid point :) However I was referring to real experience
where I've seen code that "catches all any any exception"
and simply logs it.

cheers
James

-- 
-- James Mills
--
-- "Problems are solved by method"



More information about the Python-list mailing list