[Python] Add response content to APIError exception #5166
Labels
Python
status:waiting-for-triage
An issue that is yet to be reviewed or assigned
type:feature
New experience request
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
The text was updated successfully, but these errors were encountered: