diff --git a/Wox.Infrastructure/Logger/Log.cs b/Wox.Infrastructure/Logger/Log.cs
index 11a6d2a8e..90f6406f4 100644
--- a/Wox.Infrastructure/Logger/Log.cs
+++ b/Wox.Infrastructure/Logger/Log.cs
@@ -2,6 +2,7 @@
using System.Diagnostics;
using System.IO;
using System.Runtime.CompilerServices;
+using Mindscape.Raygun4Net;
using NLog;
using NLog.Config;
using NLog.Targets;
@@ -13,7 +14,7 @@ namespace Wox.Infrastructure.Logger
public static class Log
{
public const string DirectoryName = "Logs";
-
+ private static RaygunClient _raygunClient = new RaygunClient("LG5MX0YYMCpCN2AtD0fdZw");
public static string CurrentLogDirectory { get; }
static Log()
@@ -73,6 +74,7 @@ public static void WoxError(this NLog.Logger logger, string message, System.Exce
{
Debug.WriteLine($"ERROR|{logger.Name}|{methodName}|{message}");
logger.Error($"{methodName}|{message}|{ExceptionFormatter.FormattedException(exception)}");
+ _raygunClient.Send(exception);
#if DEBUG
throw exception;
#endif
diff --git a/Wox.Infrastructure/Wox.Infrastructure.csproj b/Wox.Infrastructure/Wox.Infrastructure.csproj
index 53728d8a2..e9cff745f 100644
--- a/Wox.Infrastructure/Wox.Infrastructure.csproj
+++ b/Wox.Infrastructure/Wox.Infrastructure.csproj
@@ -91,6 +91,9 @@
1.1.4
+
+ 5.10.2
+
9.0.1
diff --git a/Wox/App.xaml.cs b/Wox/App.xaml.cs
index f7f16fd37..be8c2cf1d 100644
--- a/Wox/App.xaml.cs
+++ b/Wox/App.xaml.cs
@@ -38,7 +38,7 @@ public partial class App : IDisposable, ISingleInstanceApp
private readonly Portable _portable = new Portable();
private readonly Alphabet _alphabet = new Alphabet();
private StringMatcher _stringMatcher;
-
+
private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
private class Options
@@ -63,7 +63,6 @@ private void ParseCommandLineArgs(IList args)
[STAThread]
public static void Main()
{
- // force english exception message for better github issue
Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-US");
if (SingleInstance.InitializeAsFirstInstance(Unique))
{
@@ -88,10 +87,10 @@ private void OnStartup(object sender, StartupEventArgs e)
RegisterAppDomainExceptions();
RegisterDispatcherUnhandledException();
-
+ //throw new Exception("sentry wox exception");
_portable.PreStartCleanUpAfterPortabilityUpdate();
-
+
ImageLoader.Initialize();
diff --git a/Wox/Helper/ErrorReporting.cs b/Wox/Helper/ErrorReporting.cs
index 704a991ed..5ea282dcc 100644
--- a/Wox/Helper/ErrorReporting.cs
+++ b/Wox/Helper/ErrorReporting.cs
@@ -2,6 +2,7 @@
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
using System.Windows.Threading;
+using Mindscape.Raygun4Net;
using NLog;
using Wox.Infrastructure.Exception;
@@ -9,6 +10,8 @@ namespace Wox.Helper
{
public static class ErrorReporting
{
+ private static RaygunClient _raygunClient = new RaygunClient("LG5MX0YYMCpCN2AtD0fdZw");
+
private static void Report(Exception e, [CallerMemberName] string method = "")
{
var logger = LogManager.GetLogger(method);
@@ -19,19 +22,20 @@ private static void Report(Exception e, [CallerMemberName] string method = "")
public static void UnhandledExceptionHandleTask(Task t)
{
- //handle non-ui sub task exceptions
+ _raygunClient.Send(t.Exception);
Report(t.Exception);
}
public static void UnhandledExceptionHandleMain(object sender, UnhandledExceptionEventArgs e)
{
+ _raygunClient.Send(e.ExceptionObject as Exception);
//handle non-ui main thread exceptions
Report((Exception)e.ExceptionObject);
}
public static void DispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
{
- //handle ui thread exceptions
+ _raygunClient.Send(e.Exception);
Report(e.Exception);
//prevent application exist, so the user can copy prompted error info
e.Handled = true;
diff --git a/Wox/ViewModel/MainViewModel.cs b/Wox/ViewModel/MainViewModel.cs
index 8143fb8fd..95aa09ab7 100644
--- a/Wox/ViewModel/MainViewModel.cs
+++ b/Wox/ViewModel/MainViewModel.cs
@@ -490,7 +490,7 @@ private void QueryResults()
return;
}
_resultsQueue.Add(new ResultsForUpdate(results, plugin.Metadata, query, token, countdown));
- }, token);
+ }, token).ContinueWith(ErrorReporting.UnhandledExceptionHandleTask, TaskContinuationOptions.OnlyOnFaulted);
}
Task.Run(() =>
diff --git a/Wox/Wox.csproj b/Wox/Wox.csproj
index f162a9db0..c5dcb41a9 100644
--- a/Wox/Wox.csproj
+++ b/Wox/Wox.csproj
@@ -484,6 +484,9 @@
10.3.0
+
+ 5.10.2
+
9.0.1