mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 08:46:37 -04:00
more friendly anki 1 import error
This commit is contained in:
parent
e5f3d0b7f0
commit
d99b707d67
1 changed files with 7 additions and 3 deletions
|
@ -282,9 +282,13 @@ def onImport(mw):
|
|||
try:
|
||||
importer.run()
|
||||
except Exception, e:
|
||||
msg = _("Import failed.\n")
|
||||
msg += unicode(traceback.format_exc(), "ascii", "replace")
|
||||
showText(msg)
|
||||
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 += unicode(traceback.format_exc(), "ascii", "replace")
|
||||
showText(msg)
|
||||
else:
|
||||
showText("\n".join(importer.log))
|
||||
finally:
|
||||
|
|
Loading…
Reference in a new issue