Skip to content

Commit

Permalink
do not collect debug binary and 3rd plugin info
Browse files Browse the repository at this point in the history
  • Loading branch information
bao-qian committed May 20, 2020
1 parent 56f73a7 commit 1589637
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Wox.Infrastructure/Logger/Log.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,18 @@ public static void updateSettingsInfo(string woxLanguage)

public static void SendException(System.Exception exception)
{
string pluginDiretoryKey = nameof(Plugin.PluginPair.Metadata.PluginDirectory);
if (exception.Data.Contains(pluginDiretoryKey))
{
string pluginDirectory = exception.Data[pluginDiretoryKey] as string;
bool debug = pluginDirectory.Contains(@"\Output\Release") || pluginDirectory.Contains(@"\Output\Release");
bool thirdParty = !pluginDirectory.Contains(Constant.ProgramDirectory);
if (debug || thirdParty)
{
return;
}
}

SentrySdk.WithScope(scope =>
{
scope.Level = Sentry.Protocol.SentryLevel.Error;
Expand Down
13 changes: 13 additions & 0 deletions Wox/Helper/ErrorReporting.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.IO;
using System.Net;
using System.Net.Sockets;
using System.Runtime.CompilerServices;
Expand Down Expand Up @@ -71,6 +72,18 @@ public static IDisposable InitializedSentry(string systemLanguage)

public static string SendException(Exception exception)
{
string pluginDiretoryKey = nameof(Plugin.PluginPair.Metadata.PluginDirectory);
if (exception.Data.Contains(pluginDiretoryKey))
{
string pluginDirectory = exception.Data[pluginDiretoryKey] as string;
bool debug = pluginDirectory.Contains(@"\Output\Release") || pluginDirectory.Contains(@"\Output\Release");
bool thirdParty = !pluginDirectory.Contains(Constant.ProgramDirectory);
if (debug || thirdParty)
{
return SentryId.Empty.ToString();
}
}

SentryId id = SentryId.Empty;
SentrySdk.WithScope(scope =>
{
Expand Down

0 comments on commit 1589637

Please sign in to comment.