Make kubectl errors even more user-friendly

Omit glog prefix when v < 2, show multiline errors for configuration
problems, add new generic messages for server errors that hide some
complexity that is not relevant for users.
This commit is contained in:
Clayton Coleman
2015-04-01 23:20:09 -04:00
parent 9b5b27a12e
commit 323a44e54a
4 changed files with 86 additions and 66 deletions

View File

@@ -251,7 +251,7 @@ func TestTransformResponse(t *testing.T) {
},
Error: true,
ErrFn: func(err error) bool {
return err.Error() == "aaaaa" && apierrors.IsUnauthorized(err)
return strings.Contains(err.Error(), "server has asked for the client to provide") && apierrors.IsUnauthorized(err)
},
},
{Response: &http.Response{StatusCode: 403}, Error: true},