mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-08 12:18:50 +02:00
add more exception info
This commit is contained in:
@@ -142,6 +142,7 @@ namespace Wox.Plugin.Everything
|
|||||||
Helper.ValidateDataDirectory(bundledSDKDirectory, sdkDirectory);
|
Helper.ValidateDataDirectory(bundledSDKDirectory, sdkDirectory);
|
||||||
|
|
||||||
var sdkPath = Path.Combine(sdkDirectory, DLL);
|
var sdkPath = Path.Combine(sdkDirectory, DLL);
|
||||||
|
Constant.EverythingSDKPath = sdkPath;
|
||||||
LoadLibrary(sdkPath);
|
LoadLibrary(sdkPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
using Wox.Infrastructure;
|
||||||
using Wox.Infrastructure.Exception;
|
using Wox.Infrastructure.Exception;
|
||||||
using Wox.Infrastructure.Logger;
|
using Wox.Infrastructure.Logger;
|
||||||
using Wox.Infrastructure.UserSettings;
|
using Wox.Infrastructure.UserSettings;
|
||||||
@@ -113,6 +114,7 @@ namespace Wox.Core.Plugin
|
|||||||
return new List<PluginPair>();
|
return new List<PluginPair>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Constant.PythonPath = filename;
|
||||||
var plugins = metadatas.Select(metadata => new PluginPair
|
var plugins = metadatas.Select(metadata => new PluginPair
|
||||||
{
|
{
|
||||||
Plugin = new PythonPlugin(filename),
|
Plugin = new PythonPlugin(filename),
|
||||||
|
|||||||
@@ -24,54 +24,52 @@ namespace Wox.Infrastructure.Exception
|
|||||||
sb.AppendLine();
|
sb.AppendLine();
|
||||||
sb.AppendLine("```");
|
sb.AppendLine("```");
|
||||||
|
|
||||||
var exlist = new List<StringBuilder>();
|
var exlist = new List<StringBuilder>();
|
||||||
|
|
||||||
while (ex != null)
|
while (ex != null)
|
||||||
|
{
|
||||||
|
var exsb = new StringBuilder();
|
||||||
|
exsb.Append(ex.GetType().FullName);
|
||||||
|
exsb.Append(": ");
|
||||||
|
exsb.AppendLine(ex.Message);
|
||||||
|
if (ex.Source != null)
|
||||||
{
|
{
|
||||||
var exsb = new StringBuilder();
|
exsb.Append(" Source: ");
|
||||||
exsb.Append(ex.GetType().FullName);
|
exsb.AppendLine(ex.Source);
|
||||||
exsb.Append(": ");
|
|
||||||
exsb.AppendLine(ex.Message);
|
|
||||||
if (ex.Source != null)
|
|
||||||
{
|
|
||||||
exsb.Append(" Source: ");
|
|
||||||
exsb.AppendLine(ex.Source);
|
|
||||||
}
|
|
||||||
if (ex.TargetSite != null)
|
|
||||||
{
|
|
||||||
exsb.Append(" TargetAssembly: ");
|
|
||||||
exsb.AppendLine(ex.TargetSite.Module.Assembly.ToString());
|
|
||||||
exsb.Append(" TargetModule: ");
|
|
||||||
exsb.AppendLine(ex.TargetSite.Module.ToString());
|
|
||||||
exsb.Append(" TargetSite: ");
|
|
||||||
exsb.AppendLine(ex.TargetSite.ToString());
|
|
||||||
}
|
|
||||||
exsb.AppendLine(ex.StackTrace);
|
|
||||||
exlist.Add(exsb);
|
|
||||||
|
|
||||||
ex = ex.InnerException;
|
|
||||||
}
|
}
|
||||||
|
if (ex.TargetSite != null)
|
||||||
foreach (var result in exlist.Select(o => o.ToString()).Reverse())
|
|
||||||
{
|
{
|
||||||
sb.AppendLine(result);
|
exsb.Append(" TargetAssembly: ");
|
||||||
|
exsb.AppendLine(ex.TargetSite.Module.Assembly.ToString());
|
||||||
|
exsb.Append(" TargetModule: ");
|
||||||
|
exsb.AppendLine(ex.TargetSite.Module.ToString());
|
||||||
|
exsb.Append(" TargetSite: ");
|
||||||
|
exsb.AppendLine(ex.TargetSite.ToString());
|
||||||
}
|
}
|
||||||
sb.AppendLine("```");
|
exsb.AppendLine(ex.StackTrace);
|
||||||
sb.AppendLine();
|
exlist.Add(exsb);
|
||||||
|
|
||||||
|
ex = ex.InnerException;
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (var result in exlist.Select(o => o.ToString()).Reverse())
|
||||||
|
{
|
||||||
|
sb.AppendLine(result);
|
||||||
|
}
|
||||||
|
sb.AppendLine("```");
|
||||||
|
sb.AppendLine();
|
||||||
|
|
||||||
sb.AppendLine("## Environment");
|
sb.AppendLine("## Environment");
|
||||||
sb.AppendLine();
|
sb.AppendLine($"* Command Line: {Environment.CommandLine}");
|
||||||
sb.Append("* Command Line: ");
|
sb.AppendLine($"* Timestamp: {DateTime.Now.ToString(CultureInfo.InvariantCulture)}");
|
||||||
sb.AppendLine(Environment.CommandLine);
|
sb.AppendLine($"* Wox version: {Constant.Version}");
|
||||||
sb.Append("* Timestamp: ");
|
sb.AppendLine($"* OS Version: {Environment.OSVersion.VersionString}");
|
||||||
sb.AppendLine(DateTime.Now.ToString(CultureInfo.InvariantCulture));
|
sb.AppendLine($"* IntPtr Length: {IntPtr.Size}");
|
||||||
sb.Append("* IntPtr Length: ");
|
sb.AppendLine($"* x64: {Environment.Is64BitOperatingSystem}");
|
||||||
sb.AppendLine(IntPtr.Size.ToString());
|
sb.AppendLine($"* Python Path: {Constant.PythonPath}");
|
||||||
sb.Append("* System Version: ");
|
sb.AppendLine($"* Everything SDK Path: {Constant.EverythingSDKPath}");
|
||||||
sb.AppendLine(Environment.OSVersion.VersionString);
|
sb.AppendLine($"* CLR Version: {Environment.Version}");
|
||||||
sb.Append("* CLR Version: ");
|
sb.AppendLine($"* Installed .NET Framework: ");
|
||||||
sb.AppendLine(Environment.Version.ToString());
|
|
||||||
sb.AppendLine("* Installed .NET Framework: ");
|
|
||||||
foreach (var result in GetFrameworkVersionFromRegistry())
|
foreach (var result in GetFrameworkVersionFromRegistry())
|
||||||
{
|
{
|
||||||
sb.Append(" * ");
|
sb.Append(" * ");
|
||||||
|
|||||||
@@ -21,5 +21,8 @@ namespace Wox.Infrastructure
|
|||||||
public const string Github = "https://github.com/Wox-launcher/Wox";
|
public const string Github = "https://github.com/Wox-launcher/Wox";
|
||||||
public const string Issue = "https://github.com/Wox-launcher/Wox/issues/new";
|
public const string Issue = "https://github.com/Wox-launcher/Wox/issues/new";
|
||||||
public static readonly string Version = FileVersionInfo.GetVersionInfo(Assembly.Location).ProductVersion;
|
public static readonly string Version = FileVersionInfo.GetVersionInfo(Assembly.Location).ProductVersion;
|
||||||
|
|
||||||
|
public static string PythonPath;
|
||||||
|
public static string EverythingSDKPath;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,6 +34,10 @@ namespace Wox
|
|||||||
StringBuilder content = new StringBuilder();
|
StringBuilder content = new StringBuilder();
|
||||||
content.AppendLine($"Wox version: {Constant.Version}");
|
content.AppendLine($"Wox version: {Constant.Version}");
|
||||||
content.AppendLine($"OS Version: {Environment.OSVersion.VersionString}");
|
content.AppendLine($"OS Version: {Environment.OSVersion.VersionString}");
|
||||||
|
content.AppendLine($"IntPtr Length: {IntPtr.Size}");
|
||||||
|
content.AppendLine($"x64: {Environment.Is64BitOperatingSystem}");
|
||||||
|
content.AppendLine($"Python Path: {Constant.PythonPath}");
|
||||||
|
content.AppendLine($"Everything SDK Path: {Constant.EverythingSDKPath}");
|
||||||
content.AppendLine($"Date: {DateTime.Now.ToString(CultureInfo.InvariantCulture)}");
|
content.AppendLine($"Date: {DateTime.Now.ToString(CultureInfo.InvariantCulture)}");
|
||||||
content.AppendLine("Exception:");
|
content.AppendLine("Exception:");
|
||||||
content.AppendLine(exception.Source);
|
content.AppendLine(exception.Source);
|
||||||
|
|||||||
Reference in New Issue
Block a user