Better crash report

This commit is contained in:
bao-qian
2015-11-06 19:55:48 +00:00
parent 2dd2208f48
commit 64e020b1ad

View File

@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading;
using System.Windows;
@@ -32,9 +33,7 @@ namespace Wox
Stopwatch.Debug("Startup Time", () =>
{
base.OnStartup(e);
DispatcherUnhandledException += ErrorReporting.DispatcherUnhandledException;
AppDomain.CurrentDomain.UnhandledException += ErrorReporting.UnhandledExceptionHandle;
RegisterUnhandledException();
ThreadPool.QueueUserWorkItem(o => { ImageLoader.ImageLoader.PreloadImages(); });
Window = new MainWindow();
PluginManager.Init(Window);
@@ -43,6 +42,14 @@ namespace Wox
}
[Conditional("DEBUG")]
private void RegisterUnhandledException()
{
// let exception throw as normal is better for Debug
DispatcherUnhandledException += ErrorReporting.DispatcherUnhandledException;
AppDomain.CurrentDomain.UnhandledException += ErrorReporting.UnhandledExceptionHandle;
}
public bool OnActivate(IList<string> args)
{
CommandArgsFactory.Execute(args);