Software /
code /
prosody
Comparison
util/xmppstream.lua @ 5311:86fe6e2fa5ae
util.xmppstream: Include error stanza in error message if no error handler is available.
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Sat, 26 Jan 2013 03:39:18 +0500 |
parent | 4484:0da4e0f0f0ef |
child | 5776:bd0ff8ae98a8 |
child | 6042:1107d66d2ab2 |
comparison
equal
deleted
inserted
replaced
5310:bc60cad47397 | 5311:86fe6e2fa5ae |
---|---|
43 function new_sax_handlers(session, stream_callbacks) | 43 function new_sax_handlers(session, stream_callbacks) |
44 local xml_handlers = {}; | 44 local xml_handlers = {}; |
45 | 45 |
46 local cb_streamopened = stream_callbacks.streamopened; | 46 local cb_streamopened = stream_callbacks.streamopened; |
47 local cb_streamclosed = stream_callbacks.streamclosed; | 47 local cb_streamclosed = stream_callbacks.streamclosed; |
48 local cb_error = stream_callbacks.error or function(session, e) error("XML stream error: "..tostring(e)); end; | 48 local cb_error = stream_callbacks.error or function(session, e, stanza) error("XML stream error: "..tostring(e)..(stanza and ": "..tostring(stanza) or ""),2); end; |
49 local cb_handlestanza = stream_callbacks.handlestanza; | 49 local cb_handlestanza = stream_callbacks.handlestanza; |
50 | 50 |
51 local stream_ns = stream_callbacks.stream_ns or xmlns_streams; | 51 local stream_ns = stream_callbacks.stream_ns or xmlns_streams; |
52 local stream_tag = stream_callbacks.stream_tag or "stream"; | 52 local stream_tag = stream_callbacks.stream_tag or "stream"; |
53 if stream_ns ~= "" then | 53 if stream_ns ~= "" then |