- more error messages
authorAlex Kalimulin <alex@netxms.org>
Tue, 27 Sep 2011 19:35:11 +0000 (19:35 +0000)
committerAlex Kalimulin <alex@netxms.org>
Tue, 27 Sep 2011 19:35:11 +0000 (19:35 +0000)
src/server/smsdrv/dbemu/main.cpp

index d0c45cc..ad1fc05 100644 (file)
@@ -88,6 +88,10 @@ extern "C" BOOL EXPORT SMSDriverInit(const TCHAR *pszInitArgs)
                }       
                bRet = true;
        }
+       else
+       {
+               DbgPrintf(1, _T("%s: Unable to load configuration"), MYNAMESTR);
+       }
 
 finish:
        return bRet;
@@ -103,12 +107,17 @@ extern "C" BOOL EXPORT SMSDriverSend(const TCHAR *pszPhoneNumber, const TCHAR *p
        {
                DBBind(dbs, 1, DB_SQLTYPE_VARCHAR, pszPhoneNumber, DB_BIND_STATIC);
                DBBind(dbs, 2, DB_SQLTYPE_VARCHAR, realText, DB_BIND_STATIC);
-               if (!(bRet = DBExecute(dbs)))
-                       DbgPrintf(1, _T("%s: Cannot execute"), MYNAMESTR);
+               TCHAR errorText[DBDRV_MAX_ERROR_TEXT];
+               if (!(bRet = DBExecuteEx(dbs, errorText)))
+                       DbgPrintf(1, _T("%s: Cannot execute: %s"), MYNAMESTR, errorText);
                else
                        DbgPrintf(9, _T("%s: sent sms '%s' to %s"), MYNAMESTR, realText, pszPhoneNumber);
                DBFreeStatement(dbs);
        }
+       else
+       {
+               DbgPrintf(1, _T("%s: Cannot prepare '%s'"), MYNAMESTR, s_sqlTemplate);
+       }
 
        return bRet;
 }