Skip to content

ErrUnexpectedResponseCode should include the response headers #1918

@majewsky

Description

@majewsky

I have an API that's taking credentials (username/password) and authenticating with Keystone on behalf of the user. When rate limiting is enabled in Keystone, Keystone may return a 429 response. When that happens, I want to proxy this response to the user. I also want to forward the Retry-After header sent by Keystone, but there is no way to get at the headers of a 4xx response with the way that the error handling of ProviderClient.Request() is currently implemented. To fix this problem, I propose that ErrUnexpectedResponseCode include the response headers.

Besides the Retry-After header for 429, this can also be useful to obtain the X-Openstack-Request-Id response header to report back to the user along with the error message.

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