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

@@ -46,6 +46,7 @@ using Aaru.Database.Models;
using Aaru.Dto;
using Aaru.Logging;
using Microsoft.EntityFrameworkCore;
using Sentry;
using Spectre.Console;
using CdOffset = Aaru.Database.Models.CdOffset;
using Version = Aaru.CommonTypes.Metadata.Version;
@@ -91,14 +92,16 @@ public static class Remote
await reader.ReadToEndAsync();
data.Close();
}
catch(WebException)
catch(WebException ex)
{
// Can't connect to the server, do nothing
SentrySdk.CaptureException(ex);
}
// ReSharper disable once RedundantCatchClause
catch
catch(Exception ex)
{
SentrySdk.CaptureException(ex);
#if DEBUG
if(Debugger.IsAttached) throw;
#endif
@@ -179,8 +182,7 @@ public static class Remote
if(!response.IsSuccessStatusCode)
{
AaruLogging.Error(Localization.Core.Error_0_when_trying_to_get_updated_entities,
response.StatusCode);
AaruLogging.Error(Localization.Core.Error_0_when_trying_to_get_updated_entities, response.StatusCode);
return;
}