diff options
author | Matthew Wild <mwild1@gmail.com> | 2015-07-08 15:10:25 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2015-07-08 15:10:25 +0100 |
commit | 6f02ac5ba626731184e992e55989f101d17a949c (patch) | |
tree | 91dd0f69aa5f2c6588e75dd85867795d30dfc5aa /util/sql.lua | |
parent | e3d98453a3c22d8ae8ff4a05a7378fecfb175ae4 (diff) | |
download | prosody-6f02ac5ba626731184e992e55989f101d17a949c.tar.gz prosody-6f02ac5ba626731184e992e55989f101d17a949c.zip |
util.sql: Return failure if set_encoding() fails
Diffstat (limited to 'util/sql.lua')
-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 fc1191f9..d0da9302 100644 --- a/util/sql.lua +++ b/util/sql.lua @@ -110,7 +110,10 @@ function engine:connect() 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; |