Skip to content

Fix ErrUnexpectedResponseCode expected OK codes#2173

Merged
jtopjian merged 1 commit intogophercloud:masterfrom
ovh:fix/okcodes-error
Jun 1, 2021
Merged

Fix ErrUnexpectedResponseCode expected OK codes#2173
jtopjian merged 1 commit intogophercloud:masterfrom
ovh:fix/okcodes-error

Conversation

@reenjii
Copy link
Copy Markdown
Contributor

@reenjii reenjii commented Jun 1, 2021

For #2172

When receiving a response from OpenStack HTTP response code is checked against a list of OK codes.
This list is either specific to the call being made or generic according to the HTTP verb.
In the latter scenario, when a wrong code is received, an error is returned that does not contains the actual list of expected OK codes.
It is misleading because you may think the list of accepted codes is not correctly defined.

Actual: 'Expected HTTP response code [] when accessing [DELETE http://127.0.0.1:35195], but got 200 instead OK'
Expected: 'Expected HTTP response code [202 204] when accessing [DELETE http://127.0.0.1:35195], but got 200 instead OK'
@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.02%) to 79.918% when pulling a590bad on ovh:fix/okcodes-error into 34fae6e on gophercloud:master.

@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci bot commented Jun 1, 2021

Build failed.

@jtopjian
Copy link
Copy Markdown
Contributor

jtopjian commented Jun 1, 2021

@reenjii good catch 🙂

Are you still working on this or is this ready for review/merge?

@reenjii
Copy link
Copy Markdown
Contributor Author

reenjii commented Jun 1, 2021

@reenjii good catch

Are you still working on this or is this ready for review/merge?

It is ready for review/merge, nothing else to add it's quite straightforward :)

@jtopjian
Copy link
Copy Markdown
Contributor

jtopjian commented Jun 1, 2021

@reenjii I figured - I just don't like to assume anything 🙂

Copy link
Copy Markdown
Contributor

@jtopjian jtopjian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@reenjii LGTM - thank you!

@jtopjian jtopjian merged commit 351ac5e into gophercloud:master Jun 1, 2021
@Benzhaomin Benzhaomin deleted the fix/okcodes-error branch November 2, 2021 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants