From 760e16dfbf53bb4ed40990d39752f8e2fa020912 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Mon, 7 Jul 2014 10:41:56 +0900 Subject: [PATCH] catch more startup errors --- aqt/__init__.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/aqt/__init__.py b/aqt/__init__.py index b0c1efff8..f6c0bf2fb 100644 --- a/aqt/__init__.py +++ b/aqt/__init__.py @@ -189,6 +189,14 @@ def parseArgs(argv): return parser.parse_args(argv[1:]) def run(): + try: + _run() + except Exception, e: + QMessageBox.critical(None, "Startup Error", + "Please notify support of this error:\n\n"+ + traceback.format_exc()) + +def _run(): global mw # parse args @@ -245,7 +253,4 @@ environment points to a valid, writable folder.""") # load the main window import aqt.main mw = aqt.main.AnkiQt(app, pm, args) - app.exec_() - -if __name__ == "__main__": - run() + app.exec_() \ No newline at end of file