diff options
author | Matthew Wild <mwild1@gmail.com> | 2015-07-07 17:43:14 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2015-07-07 17:43:14 +0100 |
commit | b0b754aa3350f1425a5eed7b6bb38764346b506a (patch) | |
tree | 8e3a90605b91996ab7c0d192ef682c204037b041 /util | |
parent | 6a6e78358a50ba165d97eb62dcabecec208404dc (diff) | |
download | prosody-b0b754aa3350f1425a5eed7b6bb38764346b506a.tar.gz prosody-b0b754aa3350f1425a5eed7b6bb38764346b506a.zip |
util.sql: Allow onconnect callback to fail connection to the DB by returning false, err
Diffstat (limited to 'util')
-rw-r--r-- | util/sql.lua | 5 |
1 files changed, 4 insertions, 1 deletions
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() |