NoneType Error

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Tue Jun 17 06:38:27 CEST 2008


En Mon, 16 Jun 2008 06:29:09 -0300, Bruno Desthuilliers <bruno.42.desthuilliers at websiteburo.invalid> escribió:

> Gabriel Genellina a écrit :
>
>> It appears that you want to catch all exceptions, just use Exception for that:
>> try:
>>    ...
>> except Exception:
>>    ...
>
> Hem... That's definitively *not* an a good advice here IMHO. A catch-all
> may be useful near a program's 'top-level' to handle any other unhandled
> exception in a more user-friendly way (ie : log the error, warns whoever
> is in charge, try to cleanly dispose of resources / data / whatever so
> we don't break anything, and display a nice and visible error message to
> the user), but anywhere else you really want to know *exactly* which
> exception(s) you're expecting to handle here and let the other propagate.

Yes, thanks for putting it perfectly clear - more clear than I could have written.

-- 
Gabriel Genellina




More information about the Python-list mailing list