private static void EventSink_LogException(LogExceptionEventArgs e) { // exception passed up from the server core try { LogException(e.Exception); } catch { Console.WriteLine("Nested exception while processing: {0}", e.Exception.Message); } // do not call LogException }
public static void InvokeLogException(LogExceptionEventArgs e) { if (LogException != null) { foreach (LogExceptionEventHandler currentDelegate in LogException.GetInvocationList()) { try { currentDelegate.Invoke(e); } catch (Exception ex) { //Do nothing to avoid recursion Console.WriteLine(ex.Message); } } } }