diff options
author | Lance Stout <lancestout@gmail.com> | 2011-08-18 16:12:51 -0700 |
---|---|---|
committer | Lance Stout <lancestout@gmail.com> | 2011-08-18 16:12:51 -0700 |
commit | e02a42a008b0ee41cf3e78712d75cd3439623365 (patch) | |
tree | c03fe3f5c0f53dd6bd88710bcbd7a3f9d28413d2 | |
parent | 3e51126e18f4943a825b31c34fa11d8c37982332 (diff) | |
download | slixmpp-e02a42a008b0ee41cf3e78712d75cd3439623365.tar.gz slixmpp-e02a42a008b0ee41cf3e78712d75cd3439623365.tar.bz2 slixmpp-e02a42a008b0ee41cf3e78712d75cd3439623365.tar.xz slixmpp-e02a42a008b0ee41cf3e78712d75cd3439623365.zip |
Route all unhandled exceptions through XMLStream.exception.
Or through an equivalent override.
-rw-r--r-- | sleekxmpp/xmlstream/xmlstream.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/sleekxmpp/xmlstream/xmlstream.py b/sleekxmpp/xmlstream/xmlstream.py index 9fcead8a..19147690 100644 --- a/sleekxmpp/xmlstream/xmlstream.py +++ b/sleekxmpp/xmlstream/xmlstream.py @@ -203,6 +203,7 @@ class XMLStream(object): self.proxy_config = {} self.default_ns = '' + self.stream_ns = '' self.stream_header = "<stream>" self.stream_footer = "</stream>" @@ -790,6 +791,8 @@ class XMLStream(object): log.exception(error_msg % str(handler[0])) if hasattr(data, 'exception'): data.exception(e) + else: + self.exception(e) else: self.event_queue.put(('event', handler, copy.copy(data))) @@ -1131,6 +1134,8 @@ class XMLStream(object): log.exception(error_msg % str(func)) if hasattr(orig, 'exception'): orig.exception(e) + else: + self.exception(e) def _event_runner(self): """ @@ -1166,8 +1171,9 @@ class XMLStream(object): try: log.debug('Scheduled event: %s' % args) handler(*args[0]) - except: + except Exception as e: log.exception('Error processing scheduled task') + self.exception(e) elif etype == 'event': func, threaded, disposable = handler orig = copy.copy(args[0]) @@ -1185,6 +1191,8 @@ class XMLStream(object): log.exception(error_msg % str(func)) if hasattr(orig, 'exception'): orig.exception(e) + else: + self.exception(e) elif etype == 'quit': log.debug("Quitting event runner thread") return False |