Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

UnexpectedStatus contains an uninformative message #839

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
M1troll opened this issue Aug 16, 2023 · 0 comments · Fixed by #989
Closed

UnexpectedStatus contains an uninformative message #839

M1troll opened this issue Aug 16, 2023 · 0 comments · Fixed by #989

Comments

@M1troll
Copy link

M1troll commented Aug 16, 2023

Problem

Now when we set

raise_on_unexpected_status=True

in the client, we will only see Unexpected status code: 400 (or smt like) when any unexpected status is received. But in fact, this is an uninformative message. To find out what is the reason for this exception, we should try to reproduce the situation ourselves and check the content of the response. Sometimes it's very difficult.

Solution I'd propose

Maybe add response content to text of UnexpectedStatus exception? Or add some flag that allows us to show the contents of the response when we receive an unexpected status code?

@openapi-generators openapi-generators locked and limited conversation to collaborators Aug 16, 2023
@dbanty dbanty converted this issue into discussion #840 Aug 16, 2023
github-merge-queue bot pushed a commit that referenced this issue Mar 6, 2024
Fixes #839 and #840

This is a simple change that adds the response content to the
`UnexpectedStatus` exception, which is currently the most upvoted
feature in
[Discussions](https://github.com/openapi-generators/openapi-python-client/discussions).

---------

Co-authored-by: harabat <[email protected]>
Co-authored-by: Dylan Anthony <[email protected]>
Co-authored-by: Dylan Anthony <[email protected]>

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant