mirror of
https://github.com/Nereziel/cs2-WeaponPaints.git
synced 2026-05-22 06:55:01 +00:00
2.4b
- Nothing big ;P
This commit is contained in:
15
Database.cs
15
Database.cs
@@ -1,15 +1,11 @@
|
||||
using MySqlConnector;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using MySqlConnector;
|
||||
|
||||
namespace WeaponPaints
|
||||
{
|
||||
public class Database
|
||||
public class Database(string dbConnectionString)
|
||||
{
|
||||
private readonly string _dbConnectionString;
|
||||
|
||||
public Database(string dbConnectionString)
|
||||
{
|
||||
_dbConnectionString = dbConnectionString;
|
||||
}
|
||||
private readonly string _dbConnectionString = dbConnectionString;
|
||||
|
||||
public async Task<MySqlConnection> GetConnectionAsync()
|
||||
{
|
||||
@@ -19,8 +15,9 @@ namespace WeaponPaints
|
||||
await connection.OpenAsync();
|
||||
return connection;
|
||||
}
|
||||
catch (Exception)
|
||||
catch (Exception ex)
|
||||
{
|
||||
WeaponPaints.Instance.Logger.LogError($"Unable to connect to database: {ex.Message}");
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user