We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4497873 commit 022add1Copy full SHA for 022add1
google/api_core/exceptions.py
@@ -599,7 +599,9 @@ def from_grpc_error(rpc_exc):
599
"""
600
# NOTE(lidiz) All gRPC error shares the parent class grpc.RpcError.
601
# However, check for grpc.RpcError breaks backward compatibility.
602
- if isinstance(rpc_exc, grpc.Call) or _is_informative_grpc_error(rpc_exc):
+ if (
603
+ grpc is not None and isinstance(rpc_exc, grpc.Call)
604
+ ) or _is_informative_grpc_error(rpc_exc):
605
details, err_info = _parse_grpc_error_details(rpc_exc)
606
return from_grpc_status(
607
rpc_exc.code(),
0 commit comments