-
Notifications
You must be signed in to change notification settings - Fork 583
Core: reauthentication error is not reflected in original error #2258
Copy link
Copy link
Closed
Description
When reauthentication fails, the ErrUnableToReauthenticate struct contains only the initial openstack service error and the keystone error is missed:
gophercloud/provider_client.go
Lines 474 to 479 in 492ab2c
| err = client.Reauthenticate(prereqtok) | |
| if err != nil { | |
| e := &ErrUnableToReauthenticate{} | |
| e.ErrOriginal = respErr | |
| return nil, e | |
| } |
Since we don't catch the keystone error response, it is impossible to debug what was wrong during the reauth.
I propose to add ErrReauth struct member and print it along the service error, e.g.
func (e ErrUnableToReauthenticate) Error() string {
e.DefaultErrString = fmt.Sprintf("Unable to re-authenticate: %s: %s", e.ErrOriginal, e.ErrReauth)
return e.choseErrString()
}
Alternatively use the Info member:
err = client.Reauthenticate(prereqtok)
if err != nil {
e := &ErrUnableToReauthenticate{}
e.ErrOriginal = respErr
e.Info = err.Error()
return nil, e
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels