##// END OF EJS Templates
Catch errors in history save thread, and print a briefer error message, rather than an ugly traceback.
Thomas Kluyver -
Show More
@@ -486,6 +486,7 b' class HistorySavingThread(threading.Thread):'
486
486
487 def run(self):
487 def run(self):
488 # We need a separate db connection per thread:
488 # We need a separate db connection per thread:
489 try:
489 self.db = sqlite3.connect(self.history_manager.hist_file)
490 self.db = sqlite3.connect(self.history_manager.hist_file)
490 while True:
491 while True:
491 self.history_manager.save_flag.wait()
492 self.history_manager.save_flag.wait()
@@ -493,6 +494,9 b' class HistorySavingThread(threading.Thread):'
493 return
494 return
494 self.history_manager.save_flag.clear()
495 self.history_manager.save_flag.clear()
495 self.history_manager.writeout_cache(self.db)
496 self.history_manager.writeout_cache(self.db)
497 except Exception as e:
498 print(("The history saving thread hit an unexpected error (%s)."
499 "History will not be written to the database.") % repr(e))
496
500
497 def stop(self):
501 def stop(self):
498 """This can be called from the main thread to safely stop this thread.
502 """This can be called from the main thread to safely stop this thread.
General Comments 0
You need to be logged in to leave comments. Login now