# HG changeset patch # User Kim Alvefur # Date 1367225920 -7200 # Node ID 658c62c9ecc4557ad3a0c1745e11199178897088 # Parent 9e69ee8542d4bae62ea3ff08e1b3fef81156e6fc verse.client: Fire stream error events, so they can be handled diff -r 9e69ee8542d4 -r 658c62c9ecc4 client.lua --- 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();