mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-06 03:07:04 +02:00
Remove some useless code for error reporting
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user