C
Curious
Hi,
I've found that if I wrap my code with a try-catch block in the
fashion illustrated below, it'll do what is specified in the catch
section instead of crashing. Could anyone confirm that this is true?
If it's true, I'll modify every single method in my program to wrap it
with a try-catch block to prevent it from crashing.
FYI, the try-catch block I mentioned is as below:
void SomeMethod()
{
try
{
// Do something
}
catch (Exception e)
{
logger.Write (e.Message);
}
}
I've found that if I wrap my code with a try-catch block in the
fashion illustrated below, it'll do what is specified in the catch
section instead of crashing. Could anyone confirm that this is true?
If it's true, I'll modify every single method in my program to wrap it
with a try-catch block to prevent it from crashing.
FYI, the try-catch block I mentioned is as below:
void SomeMethod()
{
try
{
// Do something
}
catch (Exception e)
{
logger.Write (e.Message);
}
}