Software / code / prosody
Changeset
6762:ea43a5af31ca
util.sql: Return failure if set_encoding() fails
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Wed, 08 Jul 2015 15:10:25 +0100 |
| parents | 6761:b20efae224c9 |
| children | 6763:e961ac4efbb3 |
| files | util/sql.lua |
| diffstat | 1 files changed, 4 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/util/sql.lua Wed Jul 08 15:07:23 2015 +0100 +++ b/util/sql.lua Wed Jul 08 15:10:25 2015 +0100 @@ -110,7 +110,10 @@ dbh:autocommit(false); -- don't commit automatically self.conn = dbh; self.prepared = {}; - self:set_encoding(); + local ok, err = self:set_encoding(); + if not ok then + return ok, err; + end local ok, err = self:onconnect(); if ok == false then return ok, err;