Software /
code /
prosody
Changeset
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 |
parents | 6757:fc9c1a566a19 |
children | 6759:fb952032f83e |
files | util/sql.lua |
diffstat | 1 files changed, 4 insertions(+), 1 deletions(-) [+] |
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()