public void LogExceptionEventArgsTest() { var ex = new Exception("foo"); var arg = new LogExceptionEventArgs(ex, false, "bar"); Assert.AreEqual(ex, arg.Ex); Assert.False(arg.LocalOnly); Assert.AreEqual("bar", arg.ErrorMessage); }
private void ExceptionLogged(object aObj, [NotNull] LogExceptionEventArgs aEvent) { if (aEvent.ErrorMessage != null) { Dispatcher.InvokeAsync(() => { // Show the error message in the app SetLastError(aEvent.ErrorMessage); }); _toastTimer.Enabled = true; } }
void LogHelper_OnError(object sender, LogExceptionEventArgs e) { _lastException = e.Exception; }
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 }
void LogHelper_OnError(object sender, LogExceptionEventArgs e) { Console.WriteLine(e.Exception.ToString()); }