util.sql: Allow onconnect callback to fail connection to the DB by returning false...
authorMatthew Wild <mwild1@gmail.com>
Tue, 7 Jul 2015 16:43:14 +0000 (17:43 +0100)
committerMatthew Wild <mwild1@gmail.com>
Tue, 7 Jul 2015 16:43:14 +0000 (17:43 +0100)
util/sql.lua

index 92032f433556e1555c6aaad209ad2190612ff227..dedef435c3534364ec1cb80e746cfc8651965a34 100644 (file)
@@ -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()