-
Notifications
You must be signed in to change notification settings - Fork 61
Auto PR for https://github.com/microsoft/typespec/pull/5270 #2947
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
Conversation
| if response.status_code == 400: | ||
| error = self._deserialize.failsafe_deserialize(str, pipeline_response) | ||
| elif response.status_code == 404: | ||
| error = self._deserialize.failsafe_deserialize(_models.NotFoundErrorBase, pipeline_response) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| error = self._deserialize.failsafe_deserialize(_models.NotFoundErrorBase, pipeline_response) | |
| error = self._deserialize.failsafe_deserialize(_models.NotFoundErrorBase, response) |
I think it shall be response instead of pipeline_response here.
| map_error(status_code=response.status_code, response=response, error_map=error_map) | ||
| error = None | ||
| if response.status_code == 400: | ||
| error = self._deserialize.failsafe_deserialize(str, pipeline_response) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the deserialize type is str here for 400 while int for 501?
| error = self._deserialize.failsafe_deserialize(_models.NotFoundErrorBase, pipeline_response) | ||
| elif response.status_code == 501: | ||
| error = self._deserialize.failsafe_deserialize(int, pipeline_response) | ||
| raise HttpResponseError(response=response, model=error) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For 404, old code raise ResourceNotFoundError while new logic always raise HttpResponseError.
| raise HttpResponseError(response=response) | ||
| map_error(status_code=response.status_code, response=response, error_map=error_map) | ||
| error = None | ||
| if response.status_code == 400: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For 400/501, failsafe_deserialize will always return None so maybe we don't need the logic.
Auto PR for microsoft/typespec#5270