Question regarding exception....

  • Thread starter Thread starter Wallace
  • Start date Start date
W

Wallace

Hai All,

I have one doubt, here is the code sample....

try
{
for loop
{
// doing some operations.....
}
}

catch(Exception e)
{
string str = e.Message;
}

If an exception occurs within the for loop and it will come to catch
block.
My question is " after getting the e.Message how can continue the
for loop with next set of values?"

Please help...
Looking forward fir the reply...
Thanx in advance...
 
Hai All,

I have one doubt, here is the code sample....

try
{
for loop
{
// doing some operations.....
}
}

catch(Exception e)
{
string str = e.Message;
}

If an exception occurs within the for loop and it will come to catch
block.
My question is " after getting the e.Message how can continue the
for loop with next set of values?"

Please help...
Looking forward fir the reply...
Thanx in advance...

If you want to continue the loop can you not place the try ... catch inside the for loop? Also it's a bad idea normally
to catch all exceptions.
 
Back
Top