Skip to content

Core: reauthentication error is not reflected in original error #2258

@kayrus

Description

@kayrus

When reauthentication fails, the ErrUnableToReauthenticate struct contains only the initial openstack service error and the keystone error is missed:

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
                                }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions