Skip to content

Commit 7d24f3d

Browse files
fix: raise for rest transport http error (#738)
1 parent 2e97677 commit 7d24f3d

File tree

1 file changed

+3
-0
lines changed
  • gapic/templates/%namespace/%name_%version/%sub/services/%service/transports

1 file changed

+3
-0
lines changed

gapic/templates/%namespace/%name_%version/%sub/services/%service/transports/rest.py.j2

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,9 @@ class {{ service.name }}RestTransport({{ service.name }}Transport):
199199
json=body,
200200
{%- endif %}
201201
)
202+
203+
# Raise requests.exceptions.HTTPError if the status code is >= 400
204+
response.raise_for_status()
202205
{%- if not method.void %}
203206

204207
# Return the response

0 commit comments

Comments
 (0)