| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| @@ -0,0 +1,197 @@ | |||
| # Copyright 2014 Google Inc. | |||
|
|
||
| @contextlib.contextmanager | ||
| def _grpc_catch_rendezvous(): | ||
| """Re-map gRPC exceptions that happen in context. |
|
@daspecster I folded those changes into the original commit (since they were super tiny) |
Sorry, something went wrong.
|
SGTM! Thanks! I know they were nitpicky. The rest LGTM but I feel like someone else should take a crack at it. |
Sorry, something went wrong.
| try: | ||
| from grpc import StatusCode | ||
| from google.cloud.grpc.datastore.v1 import datastore_pb2_grpc | ||
| from google.cloud.datastore._gax import _DatastoreAPIOverGRPC |
| from grpc import StatusCode | ||
| from google.cloud.grpc.datastore.v1 import datastore_pb2_grpc | ||
| from google.cloud.datastore._gax import _DatastoreAPIOverGRPC | ||
| _HAVE_GRPC = True |
| yield | ||
| except exceptions.GrpcRendezvous as exc: | ||
| error_code = exc.code() | ||
| error_class = _GRPC_ERROR_MAPPING.get(error_code) |
| from grpc import StatusCode | ||
| from google.cloud.grpc.datastore.v1 import datastore_pb2_grpc | ||
| from google.cloud.datastore._gax import _DatastoreAPIOverGRPC | ||
| _HAVE_GRPC = True |
Moving datastore GAX/gRPC helpers out of _http and into dedicated module.
Moving datastore GAX/gRPC helpers out of _http and into dedicated module.
| Back | FazBrowse Home | New Git URL |
This leaves _http.py closer to what it should look like, but not all the way there (it is doing some of the transport choosing that should be done in client.py)