diff --git a/aqt/errors.py b/aqt/errors.py index b83c0f94b..64fe801b9 100644 --- a/aqt/errors.py +++ b/aqt/errors.py @@ -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,
or your deck may have a problem. diff --git a/aqt/importing.py b/aqt/importing.py index 0184ac2c2..0562da544 100644 --- a/aqt/importing.py +++ b/aqt/importing.py @@ -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: