Diff

util/sql.lua @ 6758:88b89facc3c9

util.sql: Allow onconnect callback to fail connection to the DB by returning false, err
author Matthew Wild <mwild1@gmail.com>
date Tue, 07 Jul 2015 17:43:14 +0100
parent 6748:ccf4fcfc2024
child 6759:fb952032f83e
line wrap: on
line diff
--- a/util/sql.lua	Tue Jul 07 17:42:29 2015 +0100
+++ b/util/sql.lua	Tue Jul 07 17:43:14 2015 +0100
@@ -111,7 +111,10 @@
 	self.conn = dbh;
 	self.prepared = {};
 	self:set_encoding();
-	self:onconnect();
+	local ok, err = self:onconnect();
+	if ok == false then
+		return ok, err;
+	end
 	return true;
 end
 function engine:onconnect()