I have some code that currently looks somewhat like this:
public void MainFunction()
{
try
{
SomeProblemFunction();
}
catch
{
AllFineFunction();
}
}
private void SomeProblemFunction() { ... }
private void AllFineFunction() { ... }
As you can see, I'm currently wrapping the call to SomeProblemFunction
around a try
statement because that function could fail (it relies on an outside web service call).
My question is this: should the try
statement be a) outside the problem function (like I have it now) or b) inside the problem function?