Skip to content

Commit 1060966

Browse files
author
Romain Dartigues
committed
fail earlier on API error
1 parent fc701ca commit 1060966

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

session.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,9 @@ func (s *Session) init(config *configv3.Config, configUaa *configv3.Config, conf
146146
// create an uaa client with cf_username/cf_password or client_id/client secret
147147
// to use it for authenticate requests
148148
uaaClient := uaa.NewClient(config)
149-
uaaClient.GetAPIVersion()
149+
if _, err := uaaClient.GetAPIVersion(); err != nil {
150+
return fmt.Errorf("unable to get API version: %s", err)
151+
}
150152

151153
uaaAuthWrapper := uaaWrapper.NewUAAAuthentication(nil, configUaa)
152154
uaaClient.WrapConnection(uaaAuthWrapper)

0 commit comments

Comments
 (0)