summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpixel <pixel>2008-08-06 12:07:16 +0000
committerpixel <pixel>2008-08-06 12:07:16 +0000
commitbc0b635691223bdcbe0e58f14b9fef3da1406e40 (patch)
tree01f4f97774795046f1b022b47e98fe9f5b79fdc7
parentbe063bc7a6af8d520948aaf5c9b492c82dd0d1eb (diff)
Small change to avoid exceptions to go a level too high...
-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;
}