Skip to content
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

[Python] Add response content to APIError exception #5166

Closed
geometrikal opened this issue Aug 15, 2024 · 1 comment
Closed

[Python] Add response content to APIError exception #5166

geometrikal opened this issue Aug 15, 2024 · 1 comment
Labels
Python status:waiting-for-triage An issue that is yet to be reviewed or assigned type:feature New experience request

Comments

@geometrikal
Copy link

Is your feature request related to a problem? Please describe the problem.

The openapi spec we consume (CVAT) does not define all the possible error response codes for some endpoints. This results in the APIError with message The server returned an unexpected status code and no error class is registered etc.

The hassle is I don't know what the server is going to return for these errors, and so updating the schema is done trial and error as errors occur. I had to modify HttpxRequestAdapter so I could see the error response content.

Client library/SDK language

Python

Describe the solution you'd like

Return the response content in APIError exception to help with updating the schema, and also provide the ability to parse unknown errors in the client.

Additional context

No response

@geometrikal geometrikal added status:waiting-for-triage An issue that is yet to be reviewed or assigned type:feature New experience request labels Aug 15, 2024
@msgraph-bot msgraph-bot bot added this to Kiota Aug 15, 2024
@msgraph-bot msgraph-bot bot added the Python label Aug 15, 2024
@github-project-automation github-project-automation bot moved this to Needs Triage 🔍 in Kiota Aug 15, 2024
@andrueastman
Copy link
Member

Thanks for raising this @geometrikal

This is something that has come up before and is still yet to be implemented. See #5167. Please checkout the issue for more context.

We'll close this for now to track the ask from there.

@github-project-automation github-project-automation bot moved this from Needs Triage 🔍 to Done ✔️ in Kiota Aug 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Python status:waiting-for-triage An issue that is yet to be reviewed or assigned type:feature New experience request
Projects
Archived in project
Development

No branches or pull requests

2 participants