Remove some useless code for error reporting

This commit is contained in:
bao-qian
2017-04-01 12:49:02 +01:00
parent cc6c18b5ad
commit bf4c4561ce
5 changed files with 23 additions and 45 deletions

View File

@@ -1,27 +1,25 @@
using System;
using System.Windows;
using System.Windows.Threading;
using NLog;
using Wox.Infrastructure;
using Wox.Infrastructure.Exception;
namespace Wox.Helper
{
public static class ErrorReporting
{
public static void Report(Exception e)
private static void Report(Exception e)
{
var logger = LogManager.GetLogger("UnHandledException");
logger.Fatal(ExceptionFormatter.FormatExcpetion(e));
new CrashReporter(e).Show();
var reportWindow = new ReportWindow(e);
reportWindow.Show();
}
public static void UnhandledExceptionHandle(object sender, UnhandledExceptionEventArgs e)
{
//handle non-ui thread exceptions
Application.Current.MainWindow.Dispatcher.Invoke(() =>
{
Report((Exception)e.ExceptionObject);
});
Report((Exception)e.ExceptionObject);
}
public static void DispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
@@ -29,5 +27,16 @@ namespace Wox.Helper
//handle ui thread exceptions
Report(e.Exception);
}
public static string RuntimeInfo()
{
var info = $"\nWox version: {Constant.Version}" +
$"\nOS Version: {Environment.OSVersion.VersionString}" +
$"\nIntPtr Length: {IntPtr.Size}" +
$"\nx64: {Environment.Is64BitOperatingSystem}" +
$"\nPython Path: {Constant.PythonPath}" +
$"\nEverything SDK Path: {Constant.EverythingSDKPath}";
return info;
}
}
}