Mercurial > prosody-hg
comparison plugins/mod_admin_telnet.lua @ 9748:99199b53019f
core.moduleapi: Use util.error for :send_iq errors
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Sun, 30 Dec 2018 16:03:15 +0100 |
| parents | d46c376dfe2c |
| children | 3a14815f5430 |
comparison
equal
deleted
inserted
replaced
| 9747:c8240f931a68 | 9748:99199b53019f |
|---|---|
| 1109 function (err_) err = err_; end) | 1109 function (err_) err = err_; end) |
| 1110 :finally(done); | 1110 :finally(done); |
| 1111 wait(); | 1111 wait(); |
| 1112 if ret then | 1112 if ret then |
| 1113 return true, "pong from " .. ret.stanza.attr.from; | 1113 return true, "pong from " .. ret.stanza.attr.from; |
| 1114 elseif type(err) == "table" and st.is_stanza(err.stanza) then | |
| 1115 local t, cond, text = err.stanza:get_error(); | |
| 1116 return false, text or cond or t; | |
| 1117 else | 1114 else |
| 1118 return false, tostring(err); | 1115 return false, tostring(err); |
| 1119 end | 1116 end |
| 1120 end | 1117 end |
| 1121 | 1118 |
