From 137f76396600f44532054db2829d1e7ae2fa2cb6 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Tue, 7 Jul 2015 17:43:14 +0100 Subject: util.sql: Allow onconnect callback to fail connection to the DB by returning false, err --- util/sql.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/util/sql.lua b/util/sql.lua index 92032f43..dedef435 100644 --- a/util/sql.lua +++ b/util/sql.lua @@ -111,7 +111,10 @@ function engine:connect() 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() -- cgit v1.2.3