mirror of
https://github.com/correl/SleekXMPP.git
synced 2024-11-30 19:19:55 +00:00
Route all unhandled exceptions through XMLStream.exception.
Or through an equivalent override.
This commit is contained in:
parent
3e51126e18
commit
e02a42a008
1 changed files with 9 additions and 1 deletions
|
@ -203,6 +203,7 @@ class XMLStream(object):
|
||||||
self.proxy_config = {}
|
self.proxy_config = {}
|
||||||
|
|
||||||
self.default_ns = ''
|
self.default_ns = ''
|
||||||
|
self.stream_ns = ''
|
||||||
self.stream_header = "<stream>"
|
self.stream_header = "<stream>"
|
||||||
self.stream_footer = "</stream>"
|
self.stream_footer = "</stream>"
|
||||||
|
|
||||||
|
@ -790,6 +791,8 @@ class XMLStream(object):
|
||||||
log.exception(error_msg % str(handler[0]))
|
log.exception(error_msg % str(handler[0]))
|
||||||
if hasattr(data, 'exception'):
|
if hasattr(data, 'exception'):
|
||||||
data.exception(e)
|
data.exception(e)
|
||||||
|
else:
|
||||||
|
self.exception(e)
|
||||||
else:
|
else:
|
||||||
self.event_queue.put(('event', handler, copy.copy(data)))
|
self.event_queue.put(('event', handler, copy.copy(data)))
|
||||||
|
|
||||||
|
@ -1131,6 +1134,8 @@ class XMLStream(object):
|
||||||
log.exception(error_msg % str(func))
|
log.exception(error_msg % str(func))
|
||||||
if hasattr(orig, 'exception'):
|
if hasattr(orig, 'exception'):
|
||||||
orig.exception(e)
|
orig.exception(e)
|
||||||
|
else:
|
||||||
|
self.exception(e)
|
||||||
|
|
||||||
def _event_runner(self):
|
def _event_runner(self):
|
||||||
"""
|
"""
|
||||||
|
@ -1166,8 +1171,9 @@ class XMLStream(object):
|
||||||
try:
|
try:
|
||||||
log.debug('Scheduled event: %s' % args)
|
log.debug('Scheduled event: %s' % args)
|
||||||
handler(*args[0])
|
handler(*args[0])
|
||||||
except:
|
except Exception as e:
|
||||||
log.exception('Error processing scheduled task')
|
log.exception('Error processing scheduled task')
|
||||||
|
self.exception(e)
|
||||||
elif etype == 'event':
|
elif etype == 'event':
|
||||||
func, threaded, disposable = handler
|
func, threaded, disposable = handler
|
||||||
orig = copy.copy(args[0])
|
orig = copy.copy(args[0])
|
||||||
|
@ -1185,6 +1191,8 @@ class XMLStream(object):
|
||||||
log.exception(error_msg % str(func))
|
log.exception(error_msg % str(func))
|
||||||
if hasattr(orig, 'exception'):
|
if hasattr(orig, 'exception'):
|
||||||
orig.exception(e)
|
orig.exception(e)
|
||||||
|
else:
|
||||||
|
self.exception(e)
|
||||||
elif etype == 'quit':
|
elif etype == 'quit':
|
||||||
log.debug("Quitting event runner thread")
|
log.debug("Quitting event runner thread")
|
||||||
return False
|
return False
|
||||||
|
|
Loading…
Reference in a new issue