You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the server responds with a non-200 response, openapi3 produces an exception which is not really helpful. It would be nice if the default traceback contained the server response body (in this case "Request body must not be empty")
Traceback (most recent call last):
File "client.py", line 33, in <module>
result = api.call_post_greeting(parameters={'name': 'foo'})
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "…/venv/lib64/python3.12/site-packages/openapi3/openapi.py", line 256, in __call__
return self.operation(self.base_url, *args, security=self.security, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "…/venv/lib64/python3.12/site-packages/openapi3/paths.py", line 359, in request
raise UnexpectedResponseError(result, self)
openapi3.errors.UnexpectedResponseError: Unexpected response 400 from post_greeting (expected one of 200, no default is defined)
str(exc) returns UnexpectedResponseError('Unexpected response 400 from post_greeting (expected one of 200, no default is defined)') so that would be nice to see also for uncaught exceptions.
The text was updated successfully, but these errors were encountered:
FelixSchwarz
changed the title
error message not helpful in case of server errors
default traceback not helpful in case of server errors
Dec 4, 2023
If the server responds with a non-200 response, openapi3 produces an exception which is not really helpful. It would be nice if the default traceback contained the server response body (in this case "Request body must not be empty")
str(exc)
returnsUnexpectedResponseError('Unexpected response 400 from post_greeting (expected one of 200, no default is defined)')
so that would be nice to see also for uncaught exceptions.The text was updated successfully, but these errors were encountered: