more friendly anki 1 import error

This commit is contained in:
Damien Elmes 2012-03-25 00:52:33 +09:00
parent e5f3d0b7f0
commit d99b707d67

View file

@ -282,6 +282,10 @@ def onImport(mw):
try: try:
importer.run() importer.run()
except Exception, e: except Exception, e:
if "invalidFile" in unicode(e):
showWarning(_("""\
Invalid file. Please run a DB check in Anki 1.2 and try again."""))
else:
msg = _("Import failed.\n") msg = _("Import failed.\n")
msg += unicode(traceback.format_exc(), "ascii", "replace") msg += unicode(traceback.format_exc(), "ascii", "replace")
showText(msg) showText(msg)