mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Print database connection error that was previously unused
The string copied into `aError` was previously unused because the function immediately returns. Now the error is logged to the console.
This commit is contained in:
parent
854dc47cf7
commit
31bcc59a86
|
@ -432,12 +432,12 @@ void CWorker::Print(IConsole *pConsole, CDbConnectionPool::Mode DatabaseMode)
|
|||
/* static */
|
||||
bool CDbConnectionPool::ExecSqlFunc(IDbConnection *pConnection, CSqlExecData *pData, Write w)
|
||||
{
|
||||
char aError[256] = "error message not initialized";
|
||||
if(pConnection == nullptr)
|
||||
{
|
||||
str_format(aError, sizeof(aError), "No database given");
|
||||
dbg_msg("sql", "No database given");
|
||||
return false;
|
||||
}
|
||||
char aError[256] = "unknown error";
|
||||
if(pConnection->Connect(aError, sizeof(aError)))
|
||||
{
|
||||
dbg_msg("sql", "failed connecting to db: %s", aError);
|
||||
|
|
Loading…
Reference in a new issue