mirror of
https://github.com/Radarr/Radarr.git
synced 2024-10-05 23:57:20 +02:00
Correct SQLiteException Sentry filtering
This commit is contained in:
parent
8a63f6ae37
commit
9db6289693
@ -1,4 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
|
using System.Data.SQLite;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using FluentAssertions;
|
using FluentAssertions;
|
||||||
@ -21,6 +22,7 @@ public class SentryTargetFixture : TestBase
|
|||||||
private static Exception[] FilteredExceptions = new Exception[]
|
private static Exception[] FilteredExceptions = new Exception[]
|
||||||
{
|
{
|
||||||
new UnauthorizedAccessException(),
|
new UnauthorizedAccessException(),
|
||||||
|
new SQLiteException(SQLiteErrorCode.Locked, "database is locked"),
|
||||||
new AggregateException(new Exception[]
|
new AggregateException(new Exception[]
|
||||||
{
|
{
|
||||||
new UnauthorizedAccessException(),
|
new UnauthorizedAccessException(),
|
||||||
@ -30,6 +32,7 @@ public class SentryTargetFixture : TestBase
|
|||||||
|
|
||||||
private static Exception[] NonFilteredExceptions = new Exception[]
|
private static Exception[] NonFilteredExceptions = new Exception[]
|
||||||
{
|
{
|
||||||
|
new SQLiteException(SQLiteErrorCode.Error, "it's borked"),
|
||||||
new AggregateException(new Exception[]
|
new AggregateException(new Exception[]
|
||||||
{
|
{
|
||||||
new UnauthorizedAccessException(),
|
new UnauthorizedAccessException(),
|
||||||
|
@ -248,7 +248,7 @@ public bool IsSentryMessage(LogEventInfo logEvent)
|
|||||||
var isSentry = true;
|
var isSentry = true;
|
||||||
|
|
||||||
var sqlEx = ex as SQLiteException;
|
var sqlEx = ex as SQLiteException;
|
||||||
if (sqlEx != null && !FilteredSQLiteErrors.Contains(sqlEx.ResultCode))
|
if (sqlEx != null && FilteredSQLiteErrors.Contains(sqlEx.ResultCode))
|
||||||
{
|
{
|
||||||
isSentry = false;
|
isSentry = false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user