-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[corehttp] HttpResponseError
lacks kwargs signature model
compared with same class of azure-core
#38956
Comments
Thank you for your feedback. Tagging and routing to the team member best able to assist. |
Not sure whether it is by design, but I think model signature is important. For example, when Typespec defines customized error like:
(typepsec link) map_error(status_code=response.status_code, response=response, error_map=error_map)
error = _failsafe_deserialize(_models.PetStoreError, response.json())
raise HttpResponseError(response=response, model=error) so that SDK users could access the user-defined error model easily like: try:
client.op(...)
except HttpResponseError as err:
print(err.model.code)
print(err.model.message) However, if |
Hey @msyyc, sorry for the delay in getting to this. I don't recall the specific reasoning for why
|
|
one real usage for unbranded sample code: https://github.com/allenjzhang/typespec-e2e-demo/blob/a9759159241d876891e31c20bf24009160121965/todoApp/clients/python/test/test_todo_app.py#L62 |
Created a PR: #38956, but still a bit unsure of the typing for |
HttpResponse lacks kwargs signature
model
compared with same class of azure-corecorehttp:

azure-core:

The text was updated successfully, but these errors were encountered: