Error handling in xmpp