@contextlib.contextmanager
def _grpc_catch_rendezvous():
 try:
  (yield)
 except exceptions.GrpcRendezvous as exc:
  error_code = exc.code()
  error_class = _GRPC_ERROR_MAPPING.get(error_code)
  if (error_class is None):
   raise
  else:
   raise error_class(exc.details())

@ contextlib . contextmanager def _grpc_catch_rendezvous ( ) : try : ( yield ) except exceptions . GrpcRendezvous as exc : error_code = exc . code ( ) error_class = _GRPC_ERROR_MAPPING . get ( error_code ) if ( error_class is None ) : raise else : raise error_class ( exc . details ( ) )
re-map grpc exceptions that happen in context .