Don't add 'error: ' to messages if already there

This commit is contained in:
Clayton Coleman 2016-01-23 00:41:36 -05:00
parent 6397b781ac
commit f9c48c864d

View File

@ -128,7 +128,10 @@ func checkErr(err error, handleErr func(string)) {
msg, ok := StandardErrorMessage(err)
if !ok {
msg = fmt.Sprintf("error: %s", err.Error())
msg = err.Error()
if !strings.HasPrefix(msg, "error: ") {
msg = fmt.Sprintf("error: %s", msg)
}
}
handleErr(msg)
}