1
0
mirror of https://github.com/RaidMax/IW4M-Admin.git synced 2025-06-08 06:08:20 -05:00

Remove explicit reference to underlying database provider error in stats plugin

This commit is contained in:
RaidMax 2024-02-04 12:10:13 -06:00
parent 186ed839da
commit 6f5d638a1e

View File

@ -1,5 +1,4 @@
using IW4MAdmin.Plugins.Stats.Cheat; using IW4MAdmin.Plugins.Stats.Cheat;
using IW4MAdmin.Plugins.Stats.Config;
using IW4MAdmin.Plugins.Stats.Web.Dtos; using IW4MAdmin.Plugins.Stats.Web.Dtos;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using SharedLibraryCore; using SharedLibraryCore;
@ -8,6 +7,7 @@ using SharedLibraryCore.Interfaces;
using System; using System;
using System.Collections.Concurrent; using System.Collections.Concurrent;
using System.Collections.Generic; using System.Collections.Generic;
using System.Data.Common;
using System.Linq; using System.Linq;
using System.Linq.Expressions; using System.Linq.Expressions;
using System.Threading; using System.Threading;
@ -21,8 +21,6 @@ using Data.Models.Server;
using Humanizer.Localisation; using Humanizer.Localisation;
using Microsoft.Data.Sqlite; using Microsoft.Data.Sqlite;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using MySqlConnector;
using Npgsql;
using Stats.Client.Abstractions; using Stats.Client.Abstractions;
using Stats.Config; using Stats.Config;
using Stats.Helpers; using Stats.Helpers;
@ -488,9 +486,7 @@ namespace IW4MAdmin.Plugins.Stats.Helpers
} }
catch (DbUpdateException updateException) when ( catch (DbUpdateException updateException) when (
updateException.InnerException is PostgresException { SqlState: "23503" } updateException.InnerException is DbException { SqlState: "23503" } or SqliteException { SqliteErrorCode: 787 })
|| updateException.InnerException is SqliteException { SqliteErrorCode: 787 }
|| updateException.InnerException is MySqlException { SqlState: "23503" })
{ {
_log.LogWarning("Trying to add {Client} to stats before they have been added to the database", _log.LogWarning("Trying to add {Client} to stats before they have been added to the database",
pl.ToString()); pl.ToString());