[Tutor] try except continue

tpc247@gmail.com tpc247 at gmail.com
Fri Jul 29 01:44:23 CEST 2005


hi Alan and Danny,

I think I understand what you guys are saying.  I don't believe I am
ignoring the error.  Ideally what I'd like is for the procedural
program to run through its steps and if it encounters an error, to log
the error and pick up where it left off and keep going.  I gather you
think that is bad practice, but how bad ?  If I log the error so that
I can go back and decipher what input caused, say, the
UnboundLocalError, and keep running the rest of my program, then I
feel that is better than running through the program and upon
encountering an error, stopping the program dead in its tracks.  My
program parses documents from two different sources, and currently if
the template for one source changes, then the other source's documents
are not parsed.  What I'd like is if an error is encountered, the
input (document) that caused the error is logged, and the rest of the
documents are parsed without stopping the "assembly line."  I see the
continue statement as a way for me to do this, and thus intimately
linked with exception handling.  I have a hard time figuring out why
you think this is bad practice.


On 7/28/05, Danny Yoo <dyoo at hkn.eecs.berkeley.edu> wrote:

> Hi Tpc,
> 
> I think there's some confusion about the role of 'continue'; it's doesn't
> have anything to do with exception handling.
>


More information about the Tutor mailing list