Comparison

net/xmppserver_listener.lua @ 226:ba4711c4e8d2

Committing code to get nicer tracebacks for errors, also we no longer consider such errors fatal (probably a bad thing, I know...)
author Matthew Wild <mwild1@gmail.com>
date Sat, 08 Nov 2008 20:42:23 +0000
parent 163:3fec9b512d4e
child 232:20745f8f4cf1
comparison
equal deleted inserted replaced
225:bbbd169b326b 226:ba4711c4e8d2
60 session_reset_stream(session); -- Initialise, ready for use 60 session_reset_stream(session); -- Initialise, ready for use
61 61
62 -- FIXME: Below function should be session,stanza - and xmlhandlers should use :method() notation to call, 62 -- FIXME: Below function should be session,stanza - and xmlhandlers should use :method() notation to call,
63 -- this will avoid the useless indirection we have atm 63 -- this will avoid the useless indirection we have atm
64 -- (I'm on a mission, no time to fix now) 64 -- (I'm on a mission, no time to fix now)
65 session.stanza_dispatch = function (stanza) return core_process_stanza(session, stanza); end 65
66 -- Debug version --
67 local function handleerr() print("Traceback:", debug.traceback()); end
68 session.stanza_dispatch = function (stanza) return select(2, xpcall(function () return core_process_stanza(session, stanza); end, handleerr)); end
69
70 -- session.stanza_dispatch = function (stanza) return core_process_stanza(session, stanza); end
66 71
67 end 72 end
68 if data then 73 if data then
69 session.data(conn, data); 74 session.data(conn, data);
70 end 75 end