def wx_code( job_key ): try: result = func( *args, **kwargs ) job_key.SetVariable( 'result', result ) except HydrusExceptions.PermissionException as e: job_key.SetVariable( 'error', e ) except Exception as e: job_key.SetVariable( 'error', e ) HydrusData.Print( 'CallBlockingToWx just caught this error:' ) HydrusData.DebugPrint( traceback.format_exc() ) finally: job_key.Finish()
from twisted.internet import reactor except: HG.twisted_is_broke = True except Exception as e: import traceback import os try: from include import HydrusData HydrusData.DebugPrint( 'Critical boot error occurred! Details written to crash.log!') HydrusData.PrintException(e) except: pass error_trace = traceback.format_exc() print(error_trace) if 'db_dir' in locals() and os.path.exists(db_dir): emergency_dir = db_dir else:
win = QW.QWidget(None) win.setWindowTitle('Running tests...') controller = TestController.Controller(win, only_run) def do_it(): controller.Run(win) QP.CallAfter(do_it) app.exec_() except: HydrusData.DebugPrint(traceback.format_exc()) finally: HG.view_shutdown = True controller.pubimmediate('wake_daemons') HG.model_shutdown = True controller.pubimmediate('wake_daemons') controller.TidyUp() except: