Mercurial > prosody-modules
comparison mod_log_messages_sql/mod_log_messages_sql.lua @ 1641:1fa25cfb0ad4
Merge
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Tue, 31 Mar 2015 18:31:13 +0200 |
parents | 398c4aaccf6d |
children | be08b65f2855 |
comparison
equal
deleted
inserted
replaced
1636:7fa0c41792c7 | 1641:1fa25cfb0ad4 |
---|---|
96 function sql.rollback(...) | 96 function sql.rollback(...) |
97 if connection then connection:rollback(); end -- FIXME check for rollback error? | 97 if connection then connection:rollback(); end -- FIXME check for rollback error? |
98 return ...; | 98 return ...; |
99 end | 99 end |
100 function sql.commit(...) | 100 function sql.commit(...) |
101 if not connection:commit() then return nil, "SQL commit failed"; end | 101 local ok, err = connection:commit(); |
102 if not ok then | |
103 module:log("error", "SQL commit failed: %s", tostring(err)); | |
104 return nil, "SQL commit failed: "..tostring(err); | |
105 end | |
102 return ...; | 106 return ...; |
103 end | 107 end |
104 | 108 |
105 end | 109 end |
106 | 110 |