googleapis / gapic-generator-python

Generate Python API client libraries from Protocol Buffers.
Apache License 2.0
120 stars 67 forks source link

Update error handling helper for a synchronous REST call #2116

Open ohmayr opened 2 weeks ago

ohmayr commented 2 weeks ago

google.api.core.exceptions.from_http_response only supports formatting response errors where a response is of type requests.Response.

Deprecate google.api.core.exceptions.from_http_response and use google.api.core.exceptions.format_http_response_error instead for handling response errors for a synchronous calls in GAPIC(s).

vchudnov-g commented 2 weeks ago

Let's sync on this, because it intersect with the error details clean-up project. As part of that, there's a goal to make some of the errors more uniform between gRPC and REST, so we should be deliberate about whether we do indeed want to expose the format_http_response_error parameters method and request_url.