summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/LuaSQL.cc11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/LuaSQL.cc b/lib/LuaSQL.cc
index 46ba7d3..5b25f84 100644
--- a/lib/LuaSQL.cc
+++ b/lib/LuaSQL.cc
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-/* $Id: LuaSQL.cc,v 1.11 2007-07-27 10:05:52 pixel Exp $ */
+/* $Id: LuaSQL.cc,v 1.12 2008-08-06 12:07:16 pixel Exp $ */
#ifdef _WIN32
#include <winsock.h>
@@ -155,8 +155,13 @@ int sLua_SQLConnection::SQLConnection_proceed_statics(Lua * L, int n, int caller
if (n >= 7)
cflags = L->tonumber(7);
{
- LuaSQLConnection c(new SQLConnection(host, user, passwd, db, port, socket, cflags));
- c.pushdestruct(L);
+ try {
+ LuaSQLConnection c(new SQLConnection(host, user, passwd, db, port, socket, cflags));
+ c.pushdestruct(L);
+ }
+ catch (GeneralException e) {
+ L->error("Unable to connect to MySQL server: " + String(e.GetMsg()));
+ }
}
break;
}