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

@@ -39,6 +39,7 @@ using Aaru.CommonTypes.Structs.Devices.SCSI;
using Aaru.Decoders.SCSI;
using Aaru.Decoders.SCSI.MMC;
using Aaru.Helpers;
using Sentry;
using Inquiry = Aaru.CommonTypes.Structs.Devices.SCSI.Inquiry;
namespace Aaru.Devices;
@@ -65,8 +66,10 @@ public partial class Device
{
aaruUri = new Uri(devicePath);
}
catch(Exception)
catch(Exception ex)
{
SentrySdk.CaptureException(ex);
aaruUri = null;
}

View File

@@ -34,6 +34,7 @@ using System;
using System.Runtime.InteropServices;
using Aaru.CommonTypes.Interop;
using Aaru.Logging;
using Sentry;
namespace Aaru.Devices;
@@ -132,8 +133,11 @@ public partial class Device
return remote.ListDevices();
}
catch(Exception)
catch(Exception ex)
{
SentrySdk.CaptureException(ex);
AaruLogging.Exception(ex, Localization.Error_connecting_to_host);
AaruLogging.Error(Localization.Error_connecting_to_host);
return [];