Skip to content

Commit

Permalink
Log error when SQL_FastQuery returns false while DB upgrades (#514)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bara authored Aug 29, 2022
1 parent cbe8d03 commit e7a9083
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions addons/sourcemod/scripting/surftimer/db/updater.sp
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ void CheckDatabaseForUpdates()

public void db_upgradeDatabase(int ver)
{
LogUpgradeError(ver);

if (ver == 0)
{
// SurfTimer v2.01 -> SurfTimer v2.1
Expand Down Expand Up @@ -189,6 +191,14 @@ public void db_upgradeDatabase(int ver)
CheckDatabaseForUpdates();
}

void LogUpgradeError(int version)
{
char sError[256];
SQL_GetError(g_hDb, sError, sizeof(sError));

LogMessage("SQL Error for Version %s. Error: %s", version, sError);
}

void LoopFloatDecimalTables()
{
for (int i = 0; i < sizeof(g_sDecimalTables); i++)
Expand Down

0 comments on commit e7a9083

Please sign in to comment.