Comparison

plugins/mod_c2s.lua @ 5505:0b6a99e6c1b1

mod_c2s, mod_s2s, net.http, net.http.server: Improve tracebacks (omit traceback function), to make it clearer where an error occured
author Matthew Wild <mwild1@gmail.com>
date Mon, 22 Apr 2013 12:35:52 +0100
parent 5370:7838acadb0fa
child 5518:0220093e34fa
comparison
equal deleted inserted replaced
5504:b760b5f0c2b0 5505:0b6a99e6c1b1
114 session.log("info", "Session closed by remote with error: %s", text); 114 session.log("info", "Session closed by remote with error: %s", text);
115 session:close(nil, text); 115 session:close(nil, text);
116 end 116 end
117 end 117 end
118 118
119 local function handleerr(err) log("error", "Traceback[c2s]: %s: %s", tostring(err), traceback()); end 119 local function handleerr(err) log("error", "Traceback[c2s]: %s", traceback(tostring(err), 2)); end
120 function stream_callbacks.handlestanza(session, stanza) 120 function stream_callbacks.handlestanza(session, stanza)
121 stanza = session.filter("stanzas/in", stanza); 121 stanza = session.filter("stanzas/in", stanza);
122 if stanza then 122 if stanza then
123 return xpcall(function () return core_process_stanza(session, stanza) end, handleerr); 123 return xpcall(function () return core_process_stanza(session, stanza) end, handleerr);
124 end 124 end