Say I want a function to always return true or false even if an exception is thrown, is the following correct?
public bool FooBar(){
try{
PossibleDodgyMethod();
return true;
}
catch (Exception ex){
return false;
throw MyCustomException;
}
}
Am I right in saying that no code after the throw is executed?
public bool FooBar(){
try{
PossibleDodgyMethod();
return true;
}
catch (Exception ex){
return false;
throw MyCustomException;
}
}
Am I right in saying that no code after the throw is executed?