parent
ea640dfb6d
commit
bed90a832e
3 changed files with 7 additions and 3 deletions
|
@ -149,7 +149,11 @@ func (t *JWTTransport) refreshJwtToken() error {
|
|||
defer resp.Body.Close()
|
||||
|
||||
if resp.StatusCode < 200 || resp.StatusCode >= 300 {
|
||||
return fmt.Errorf("received response status %q when fetching %v", resp.Status, req.URL)
|
||||
log.Debugf("received response status %q when fetching %v", resp.Status, req.URL)
|
||||
err = CheckResponse(resp)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
if err := json.NewDecoder(resp.Body).Decode(&response); err != nil {
|
||||
|
|
|
@ -88,7 +88,7 @@ func TestWatcherAuth(t *testing.T) {
|
|||
MachineID: &mycfg.MachineID,
|
||||
Password: &mycfg.Password,
|
||||
})
|
||||
assert.Contains(t, err.Error(), "403 Forbidden")
|
||||
assert.Contains(t, err.Error(), "API error: access forbidden")
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -106,7 +106,7 @@ func TestNewClientKo(t *testing.T) {
|
|||
})
|
||||
|
||||
_, _, err = client.Alerts.List(context.Background(), AlertsListOpts{})
|
||||
assert.Contains(t, err.Error(), `received response status "401 Unauthorized"`)
|
||||
assert.Contains(t, err.Error(), `API error: bad login/password`)
|
||||
log.Printf("err-> %s", err)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue