I have a code that looks like this:
string TheString = string.Empty; try { TheString = SomeDangerousMethod(); } catch { TheString = SomeSaferMethod(); } return TheString;
It turns out that SomeSaferMethod not so secure and may also fail in some edge case. For this reason, I created a method called SuperSafeMethod that I want to call if SomeSaferMethod also does not work in the catch statement.
How can I change my try catch so that there is a third level of execution that fires if both SomeDangerousMethod and SomeSaferMethod fail?
Thanks.
source share