Skip to content

Commit

Permalink
Remove explicit reference to underlying database provider error in st…
Browse files Browse the repository at this point in the history
…ats plugin
  • Loading branch information
RaidMax committed Feb 4, 2024
1 parent 186ed83 commit 6f5d638
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions Plugins/Stats/Helpers/StatManager.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using IW4MAdmin.Plugins.Stats.Cheat;
using IW4MAdmin.Plugins.Stats.Config;
using IW4MAdmin.Plugins.Stats.Web.Dtos;
using Microsoft.EntityFrameworkCore;
using SharedLibraryCore;
Expand All @@ -8,6 +7,7 @@
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Data.Common;
using System.Linq;
using System.Linq.Expressions;
using System.Threading;
Expand All @@ -21,8 +21,6 @@
using Humanizer.Localisation;
using Microsoft.Data.Sqlite;
using Microsoft.Extensions.Logging;
using MySqlConnector;
using Npgsql;
using Stats.Client.Abstractions;
using Stats.Config;
using Stats.Helpers;
Expand Down Expand Up @@ -488,9 +486,7 @@ public async Task<EFClientStatistics> AddPlayer(EFClient pl)
}

catch (DbUpdateException updateException) when (
updateException.InnerException is PostgresException { SqlState: "23503" }
|| updateException.InnerException is SqliteException { SqliteErrorCode: 787 }
|| updateException.InnerException is MySqlException { SqlState: "23503" })
updateException.InnerException is DbException { SqlState: "23503" } or SqliteException { SqliteErrorCode: 787 })
{
_log.LogWarning("Trying to add {Client} to stats before they have been added to the database",
pl.ToString());
Expand Down

0 comments on commit 6f5d638

Please sign in to comment.