mirror of
https://github.com/ankitects/anki.git
synced 2025-09-25 01:06:35 -04:00
catch errors in inital startup and report them before dying
This commit is contained in:
parent
4b978e0d86
commit
ea42e18a58
1 changed files with 68 additions and 63 deletions
|
@ -30,6 +30,7 @@ config = ankiqt.config
|
||||||
class AnkiQt(QMainWindow):
|
class AnkiQt(QMainWindow):
|
||||||
def __init__(self, app, config, args):
|
def __init__(self, app, config, args):
|
||||||
QMainWindow.__init__(self)
|
QMainWindow.__init__(self)
|
||||||
|
try:
|
||||||
self.errorOccurred = False
|
self.errorOccurred = False
|
||||||
self.inDbHandler = False
|
self.inDbHandler = False
|
||||||
self.reviewingStarted = False
|
self.reviewingStarted = False
|
||||||
|
@ -95,6 +96,10 @@ class AnkiQt(QMainWindow):
|
||||||
self.deck.syncName):
|
self.deck.syncName):
|
||||||
self.syncDeck(interactive=False)
|
self.syncDeck(interactive=False)
|
||||||
signal.signal(signal.SIGINT, self.onSigInt)
|
signal.signal(signal.SIGINT, self.onSigInt)
|
||||||
|
except:
|
||||||
|
ui.utils.showInfo("Error during startup:\n%s" %
|
||||||
|
traceback.format_exc())
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
def onSigInt(self, signum, frame):
|
def onSigInt(self, signum, frame):
|
||||||
self.close()
|
self.close()
|
||||||
|
|
Loading…
Reference in a new issue