File tree 1 file changed +8
-2
lines changed
1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -56,6 +56,7 @@ type LoginOptions struct {
56
56
Config * restclient.Config
57
57
Reader io.Reader
58
58
Out io.Writer
59
+ ErrOut io.Writer
59
60
60
61
// cert data to be used when authenticating
61
62
CertFile string
@@ -231,10 +232,15 @@ func (o *LoginOptions) gatherAuthInfo() error {
231
232
// client is connecting to the right host:port
232
233
if statusErr , ok := err .(* kerrors.StatusError ); ok {
233
234
if statusErr .Status ().Code == http .StatusInternalServerError {
234
- return fmt .Errorf ( "error: The server was unable to respond - %v" , suggestion )
235
+ fmt .Fprintf ( o . ErrOut , "error: The server was unable to respond - %v" , suggestion )
235
236
}
237
+ } else {
238
+ fmt .Fprintf (o .ErrOut , "error: %v - %v\n " , err , suggestion )
236
239
}
237
- return fmt .Errorf ("%v - %v" , err , suggestion )
240
+
241
+ // TODO: set errout
242
+ // return error as-is, as method caller expects to check its type
243
+ return err
238
244
}
239
245
clientConfig .BearerToken = token
240
246
You can’t perform that action at this time.
0 commit comments