Software /
code /
verse
Diff
client.lua @ 336:658c62c9ecc4
verse.client: Fire stream error events, so they can be handled
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Mon, 29 Apr 2013 10:58:40 +0200 |
parent | 329:2787e038bea2 |
child | 344:ea668c47e1bd |
line wrap: on
line diff
--- a/client.lua Fri Feb 15 20:45:31 2013 +0100 +++ b/client.lua Mon Apr 29 10:58:40 2013 +0200 @@ -51,6 +51,14 @@ return stream:event("stanza", stanza); end +function stream_callbacks.error(stream, e, stanza) + if stream:event(e, stanza) == nil then + local err = stanza:get_child(nil, "urn:ietf:params:xml:ns:xmpp-streams"); + local text = stanza:get_child_text("text", "urn:ietf:params:xml:ns:xmpp-streams"); + error(err.name..(text and ": "..text)); + end +end + function stream:reset() if self.stream then self.stream:reset();