Add Sentry to catch exceptions.

This commit is contained in:
2025-08-20 18:51:05 +01:00
parent d5ef2c874d
commit c1f4b92548
70 changed files with 1213 additions and 1087 deletions

View File

@@ -55,4 +55,9 @@
<LastGenOutput>Localization.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<Reference Include="Sentry">
<HintPath>..\..\..\..\.nuget\packages\sentry\5.14.1\lib\net9.0\Sentry.dll</HintPath>
</Reference>
</ItemGroup>
</Project>

View File

@@ -42,6 +42,7 @@ using System.IO;
using System.Runtime.InteropServices;
using System.Runtime.InteropServices.Marshalling;
using System.Security.Principal;
using Sentry;
namespace Aaru.CommonTypes.Interop;
@@ -86,8 +87,10 @@ public static partial class DetectOS
{
isAdmin = false;
}
catch(Exception)
catch(Exception ex)
{
SentrySdk.CaptureException(ex);
isAdmin = false;
}
finally
@@ -237,7 +240,7 @@ public static partial class DetectOS
/// <returns>Current operating system version</returns>
public static string GetVersion()
{
var environ = Environment.OSVersion.Version.ToString();
string environ = Environment.OSVersion.Version.ToString();
switch(GetRealPlatformID())
{

View File

@@ -36,6 +36,7 @@ using System.IO;
using Aaru.CommonTypes.Enums;
using Aaru.CommonTypes.Interfaces;
using Microsoft.Extensions.DependencyInjection;
using Sentry;
namespace Aaru.CommonTypes;
@@ -273,9 +274,10 @@ public class PluginRegister
else
noFilter = filter;
}
catch(IOException)
catch(IOException ex)
{
// Ignore and continue
SentrySdk.CaptureException(ex);
}
}