mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 08:46:37 -04:00
friendlify some error messages
This commit is contained in:
parent
fdbed4ba17
commit
8a7c3a9f3c
2 changed files with 6 additions and 1 deletions
|
@ -50,6 +50,8 @@ class ErrorHandler(QObject):
|
|||
return
|
||||
if "Pyaudio not" in error:
|
||||
return showWarning(_("Please install PyAudio"))
|
||||
if "no default output" in error:
|
||||
return showWarning(_("Please connect a microphone."))
|
||||
stdText = _("""\
|
||||
An error occurred. It may have been caused by a harmless bug, <br>
|
||||
or your deck may have a problem.
|
||||
|
|
|
@ -148,7 +148,10 @@ you can enter it here. Use \\t to represent tab."""),
|
|||
self.importer.run()
|
||||
except Exception, e:
|
||||
msg = _("Import failed.\n")
|
||||
msg += unicode(traceback.format_exc(), "ascii", "replace")
|
||||
if "1-character string" in unicode(e):
|
||||
msg += unicode(e)
|
||||
else:
|
||||
msg += unicode(traceback.format_exc(), "ascii", "replace")
|
||||
showText(msg)
|
||||
return
|
||||
finally:
|
||||
|
|
Loading…
Reference in a new issue