Simplified the exception hierarchy and refactor.#3593
Simplified the exception hierarchy and refactor.#3593sima-zhu merged 17 commits intoAzure:masterfrom
Conversation
|
Can one of the admins verify this patch? |
|
The confusing aspect for me is that To me it feels like |
I don't have a strong point against the naming, so I followed their definition. If we have strong points of implementing in another way, we can coordinate with Python team and then make changes in both pkgs. Let me know your thoughts. |
|
I would not expect a ServiceResponseException to include a HTTP response. A HTTP request, on the other hand, yes, I would expect it to include that. |
|
Agreed to remove the HttpResponse field from ServiceResponseException. |
|
The ServiceRequestException currently takes in HttpRequest. I added in convenient to people who wants to take a peek at the bad request. Let me know your thoughts on the field as well. |
| /** | ||
| * Information about the associated HTTP response. | ||
| */ | ||
| private HttpRequest request; |
There was a problem hiding this comment.
The ServiceResponseException class was changed to not contain the HttpResponse information. It now feels a little odd that the ServiceRequestException includes the HttpRequest information. What do you think?
There was a problem hiding this comment.
I am ok to remove this out. I added this for checking what the failed request is. I can remove for now, since it is not that hard to add it back if needed.
There was a problem hiding this comment.
My inclination, rather than remove the HttpRequest field, would have been to rename the ServiceRequestException class to instead be HttpRequestException.
|
Have sent out an email to lock down the design. Will wait for the response and sign off before implementation here. |
This PR addressed the issue #3503.
Major changes:
ServerException (status code of 5XX). It deleted because the client does not need to distinguish different server issue (501 or 503), they can just catch the base one HttpResponseException, and log details if they care. Another reason is it is independent one, so if the client actually needed, it does not take too much efforts to add it in.
ReadTimeoutException: This one has the same functionality as ServiceResponseException. (Delete to keep hierarchy clean)
DecodeException: move to HttpResponseException (Originally under ServiceResponseException). Decode one tend to catch exception with status code, get the right response format which cannot parse or understand by client.