Best Way to Handle All Exceptions
steven at REMOVE.THIS.cybersource.com.au
Wed Jul 15 10:58:36 CEST 2009
On Tue, 14 Jul 2009 08:53:33 -0700, Carl Banks wrote:
> On Jul 14, 2:14 am, Steven D'Aprano
> <ste... at REMOVE.THIS.cybersource.com.au> wrote:
>> On Tue, 14 Jul 2009 01:30:48 -0700, Carl Banks wrote:
>> > Seriously, do you *ever* take more than 2 seconds to consider whether
>> > you might be missing something obvious before following up with these
>> > indignant knee-jerk responses?
>> Obviously not.
>> > Or would you rather let all unexpected exceptions print to standard
>> > error, which is often a black hole in non-interactive sitations?
>> Fair point. Of course you're right.
> I don't want to be mean or anything. I agree with you on 95% of issues
> probably, of course I only follow up to disagree....
No problem Carl. You were right, in this instance I was being a smartarse
and ended up being too clever for my own good. There are cases where you
want to catch all exceptions, not to hide them, but to process them in
some way (possibly logging the error and then exiting).
More information about the Python-list