-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.xaml.cs
40 lines (36 loc) · 1.18 KB
/
App.xaml.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Windows;
using System.Net;
using System.Threading;
using System.Web;
using System.Collections.Specialized;
using ProcessCapture.Log;
namespace OpenSpanWPF
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
public App()
{
this.DispatcherUnhandledException += new System.Windows.Threading.DispatcherUnhandledExceptionEventHandler(App_DispatcherUnhandledException);
}
private void App_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)
{
try
{
string file = Logger.GetInstance().Log(e.Exception);
MessageBox.Show("An error has occurred - it has been saved to " + file + " - please email this to [email protected]");
}
catch(Exception ex)
{
MessageBox.Show("An error has occurred - but can not be saved to disk");
}
}
}
}