diff options
author | Tres Seaver <tseaver@palladion.com> | 2021-11-03 14:18:12 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-03 12:18:12 -0600 |
commit | 060b339e3af296dd1772bfc1b4a0d2b4264cae1f (patch) | |
tree | 9d92f63acfa66b0810c455709cc4777fc30e0084 /google | |
parent | 214d88b54142628f7ecf5d49d3515f353db8aaf5 (diff) | |
download | python-api-core-060b339e3af296dd1772bfc1b4a0d2b4264cae1f.tar.gz |
fix: handle bare 'grpc.Call' in 'from_grpc_error' (#298)
* fix: handle bare 'grpc.Call' in 'from_grpc_error'
Fixes: #297.
* tests: add assertion for 'exception.details'
Diffstat (limited to 'google')
-rw-r--r-- | google/api_core/exceptions.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/google/api_core/exceptions.py b/google/api_core/exceptions.py index fdb2109..6b1b6f7 100644 --- a/google/api_core/exceptions.py +++ b/google/api_core/exceptions.py @@ -487,9 +487,14 @@ def _is_informative_grpc_error(rpc_exc): def _parse_grpc_error_details(rpc_exc): - status = rpc_status.from_call(rpc_exc) + try: + status = rpc_status.from_call(rpc_exc) + except NotImplementedError: # workaround + return [] + if not status: return [] + possible_errors = [ error_details_pb2.BadRequest, error_details_pb2.PreconditionFailure, |