better warning when apkg invalid

This commit is contained in:
Damien Elmes 2013-05-17 14:22:49 +09:00
parent 0afce5f19a
commit 400571306a

View file

@ -306,6 +306,13 @@ backup, please see the 'Backups' section of the user manual."""))
mw.progress.start(immediate=True)
try:
importer.run()
except zipfile.BadZipfile:
msg = _("""\
This file does not appear to be a valid .apkg file. If you're getting this \
error from a file downloaded from AnkiWeb, chances are that your download \
failed. Please try again, and if the problem persists, please try again \
with a different browser.""")
showWarning(msg)
except Exception, e:
if "invalidFile" in unicode(e):
msg = _("""\