mirror of
https://github.com/Radarr/Radarr.git
synced 2025-04-24 14:37:07 -04:00
Correct SQLiteException Sentry filtering
This commit is contained in:
parent
8a63f6ae37
commit
9db6289693
2 changed files with 4 additions and 1 deletions
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using System.Data.SQLite;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using FluentAssertions;
|
||||
|
@ -21,6 +22,7 @@ namespace NzbDrone.Common.Test.InstrumentationTests
|
|||
private static Exception[] FilteredExceptions = new Exception[]
|
||||
{
|
||||
new UnauthorizedAccessException(),
|
||||
new SQLiteException(SQLiteErrorCode.Locked, "database is locked"),
|
||||
new AggregateException(new Exception[]
|
||||
{
|
||||
new UnauthorizedAccessException(),
|
||||
|
@ -30,6 +32,7 @@ namespace NzbDrone.Common.Test.InstrumentationTests
|
|||
|
||||
private static Exception[] NonFilteredExceptions = new Exception[]
|
||||
{
|
||||
new SQLiteException(SQLiteErrorCode.Error, "it's borked"),
|
||||
new AggregateException(new Exception[]
|
||||
{
|
||||
new UnauthorizedAccessException(),
|
||||
|
|
|
@ -248,7 +248,7 @@ namespace NzbDrone.Common.Instrumentation.Sentry
|
|||
var isSentry = true;
|
||||
|
||||
var sqlEx = ex as SQLiteException;
|
||||
if (sqlEx != null && !FilteredSQLiteErrors.Contains(sqlEx.ResultCode))
|
||||
if (sqlEx != null && FilteredSQLiteErrors.Contains(sqlEx.ResultCode))
|
||||
{
|
||||
isSentry = false;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue