Flow Control with Exception Handling
I'm using exception handling to catch errors, but cannot figure out how to prevent the code after the exception from executing. Example:
try
Statement 1
catch
Error handling for Statement 1
Statement 2
Statement 3
If there is an error with Statement 1 (in this case a null value in a text box), I don't want Statements 2 & 3 to execute since they rely on a valid value. Also Statements 2 & 3 deserve their own try...catch statements. So, I am left with a hugely nested set of try...catches to handle flow control.
I know this is not correct. How should I handle it?
Thanks,
Scott