script/stream/recorder_stream.py
changeset 1074 94d3d8f5eb9d
parent 919 e126d3e1e186
child 1497 14a9bed2e3cd
equal deleted inserted replaced
1073:5285e22389ab 1074:94d3d8f5eb9d
   566     except Exception as e:
   566     except Exception as e:
   567         utils.get_logger().exception("Error in main thread")        
   567         utils.get_logger().exception("Error in main thread")        
   568         outfile = StringIO.StringIO()
   568         outfile = StringIO.StringIO()
   569         try:
   569         try:
   570             traceback.print_exc(file=outfile)
   570             traceback.print_exc(file=outfile)
   571             stop_args = {'error': repr(e), 'message': getattr(e, 'message', ''), 'stacktrace':outfile.getvalue()}
   571             stop_args = {'error': repr(e), 'message': repr(e), 'stacktrace':outfile.getvalue()}
   572         finally:
   572         finally:
   573             outfile.close()
   573             outfile.close()
   574         raise
   574         raise
   575     finally:    
   575     finally:    
   576         add_process_event(event_type="shutdown", args=stop_args, session_maker=Session)
   576         add_process_event(event_type="shutdown", args=stop_args, session_maker=Session)