mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Add Sentry to catch exceptions.
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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())
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user