void App_DispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e) { // Process unhandled exception SystemError.Send("Unhandled Error", e.Exception); // Prevent default unhandled exception processing e.Handled = true; }
public async void EndCapture() { if (!this.CaptureInProgress || this.waitingForCapturePipeline) { return; } try { this.capturePipeline.Stop(); this.capturePipeline.Timer.Tick -= this.Timer_Tick; this.waitingForCapturePipeline = true; await CompleteCapture(MaxWaitTime); //--setup the output files var fileCollection = new List <OutputFile>(); if (this.CanCaptureWII) { if (this.WIILeftViewModel.Connected) { var wiiLeftRawFile = new RawGrfFile(this.WIILeftViewModel.DeviceID); fileCollection.Add(wiiLeftRawFile); } if (this.WIIRightViewModel.Connected) { var wiiRightRawFile = new RawGrfFile(this.WIIRightViewModel.DeviceID); fileCollection.Add(wiiRightRawFile); } } this.dataOutputModule.Save(fileCollection, Path.Combine(Settings.Default.OutputPath, Settings.Default.SubjectName), this.captureFileName); this.dataOutputModule.Clear(); } catch (Exception ex) { SystemError.Send(ex.Message, ex); } finally { // try to clean up memory GC.Collect(); GC.WaitForPendingFinalizers(); this.CaptureInProgress = false; this.dataOutputModule.Dispose(); this.capturePipeline.Dispose(); Debug.WriteLine("Capture complete."); SystemMessage.Send("Capture Complete!"); this.waitingForCapturePipeline = false; CommandManager.InvalidateRequerySuggested(); } }
void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) { SystemError.Send("Unhandled Error", e.ExceptionObject as Exception); }
/// <summary> /// Error occured in the force provider /// </summary> /// <param name="error">The error that occured</param> public void OnError(Exception error) { SystemError.Send(string.Format("Error occured processing force frame:{0}", error.ToString())); }