public static void ProvokeNonNestedError() { try { var stringFunctions = new StringFunctions(); var slice = stringFunctions.GetSubstring("hello", 10); } catch (Exception ex) { log4netLogger.Error(ex.ToString()); } }
public string Calculate(string input) { try { var slice = new StringFunctions().GetSubstring(input, 10); return "Your result is " + slice; } catch (ArgumentOutOfRangeException ex) { throw new ApplicationException("This is really bad. Data is: " + input, ex); } }