Add the exception's message to the traceback

This commit is contained in:
Joseph Schorr 2014-10-08 14:20:57 -04:00
parent 6007789480
commit 7ef3be5842

View file

@ -44,8 +44,9 @@ def _run(get_producer, queues, chunk_size, args):
while True:
try:
data = producer(chunk_size) or None
except Exception:
data = Exception("".join(traceback.format_exception(*sys.exc_info())))
except Exception as ex:
message = '%s\n%s' % (ex.message, "".join(traceback.format_exception(*sys.exc_info())))
data = Exception(message)
for queue in queues:
try: