friendlify some error messages

This commit is contained in:
Damien Elmes 2012-04-22 07:38:47 +09:00
parent fdbed4ba17
commit 8a7c3a9f3c
2 changed files with 6 additions and 1 deletions

View file

@ -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.

View file

@ -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: