# HG changeset patch # User Matthew Wild # Date 1373316091 -3600 # Node ID c4200292758c611c96856616a1fda45ce9208b79 # Parent 24b6eb65480cde0c60a249885ac576bbaf427e01# Parent a49f32e3d73bb718d462b7a1a4b03e302d402348 Merge 0.9->trunk diff -r 24b6eb65480c -r c4200292758c plugins/mod_component.lua --- a/plugins/mod_component.lua Mon Jul 01 22:17:31 2013 +0200 +++ b/plugins/mod_component.lua Mon Jul 08 21:41:31 2013 +0100 @@ -9,6 +9,7 @@ module:set_global(); local t_concat = table.concat; +local traceback = debug.traceback; local logger = require "util.logger"; local sha1 = require "util.hashes".sha1; @@ -183,6 +184,7 @@ session:close(); end +local function handleerr(err) log("error", "Traceback[component]: %s", traceback(tostring(err), 2)); end function stream_callbacks.handlestanza(session, stanza) -- Namespaces are icky. if not stanza.attr.xmlns and stanza.name == "handshake" then @@ -213,7 +215,10 @@ return; end end - return core_process_stanza(session, stanza); + + if stanza then + return xpcall(function () return core_process_stanza(session, stanza) end, handleerr); + end end --- Closing a component connection