Skip to content

Commit

Permalink
Merge branch 'master' into fix-datetime-comparisons
Browse files Browse the repository at this point in the history
  • Loading branch information
gcf-merge-on-green[bot] authored May 20, 2021
2 parents ef9a4b9 + edb8c63 commit 579af0a
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ from typing import Callable, Dict, Optional, Sequence, Tuple
from google.api_core import operations_v1
{% endif %}
from google.api_core import gapic_v1 # type: ignore
from google.auth import credentials as ga_credentials # type: ignore
from google.auth.transport.grpc import SslCredentials # type: ignore
from google.api_core import exceptions as core_exceptions # type: ignore
from google.auth import credentials as ga_credentials # type: ignore
from google.auth.transport.grpc import SslCredentials # type: ignore

import grpc # type: ignore

Expand Down Expand Up @@ -214,8 +215,10 @@ class {{ service.name }}RestTransport({{ service.name }}Transport):
{% endif %}
)

# Raise requests.exceptions.HTTPError if the status code is >= 400
response.raise_for_status()
# In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception
# subclass.
if response.status_code >= 400:
raise core_exceptions.from_http_response(response)
{% if not method.void %}

# Return the response
Expand Down

0 comments on commit 579af0a

Please sign in to comment.