in reply to Error module
To answer the second part of your question: you shouldn't return to the try block once an exception has been thrown. The exception indicates that some abnormal condition has occured (say for instance, a file couldn't be opened), so the rest of the code in the try block should not be executed since it would lead to unpredictable behaviour or simply crash the program.
Just my 2 cents, -gjb-
Update: As to dragonchild's remark below: in such a case it's cleaner to work with a finer granularity for the try/catch. I.e. if the caller doesn't consider the exception an error, only the statement generating it should be put in the try/catch construct, no other statements that can be executed regardless of the nature of the exception or after the catch block has done some recovery.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re2: Error module
by dragonchild (Archbishop) on Aug 18, 2003 at 14:13 UTC |