diff options
author | Lance Stout <lancestout@gmail.com> | 2010-12-21 11:33:40 -0500 |
---|---|---|
committer | Lance Stout <lancestout@gmail.com> | 2010-12-21 11:33:40 -0500 |
commit | 3657bf66363844bf7351ea84279eeb74b0449d5f (patch) | |
tree | e3a89300ae19a3b9f78596f42a05a5926e3ddc1f /sleekxmpp/stanza | |
parent | adade2e5eccf5a0c48b0b6541fc3d990d732710c (diff) | |
parent | f97f6e5985b5781ce87a2095b4bf9cccb12ae978 (diff) | |
download | slixmpp-3657bf66363844bf7351ea84279eeb74b0449d5f.tar.gz slixmpp-3657bf66363844bf7351ea84279eeb74b0449d5f.tar.bz2 slixmpp-3657bf66363844bf7351ea84279eeb74b0449d5f.tar.xz slixmpp-3657bf66363844bf7351ea84279eeb74b0449d5f.zip |
Merge branch 'develop' into roster
Diffstat (limited to 'sleekxmpp/stanza')
-rw-r--r-- | sleekxmpp/stanza/rootstanza.py | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/sleekxmpp/stanza/rootstanza.py b/sleekxmpp/stanza/rootstanza.py index 6975c72a..8123c5f8 100644 --- a/sleekxmpp/stanza/rootstanza.py +++ b/sleekxmpp/stanza/rootstanza.py @@ -54,16 +54,17 @@ class RootStanza(StanzaBase): e.extension_args) self['error'].append(extxml) self['error']['type'] = e.etype + self.send() else: - # We probably didn't raise this on purpose, so send a traceback + # We probably didn't raise this on purpose, so send an error stanza self['error']['condition'] = 'undefined-condition' - if sys.version_info < (3, 0): - self['error']['text'] = "SleekXMPP got into trouble." - else: - self['error']['text'] = traceback.format_tb(e.__traceback__) - log.exception('Error handling {%s}%s stanza' % - (self.namespace, self.name)) - self.send() - + self['error']['text'] = "SleekXMPP got into trouble." + self.send() + # log the error + log.exception('Error handling {%s}%s stanza' % + (self.namespace, self.name)) + # Finally raise the exception, so it can be handled (or not) + # at a higher level by using sys.excepthook. + raise e register_stanza_plugin(RootStanza, Error) |