code: def test_rpc_error(self):
      # This error handling is implemented with a context manager used
      # for all the methods, so take `list_plugins` as representative.
      cases = [
          (
              grpc.StatusCode.INVALID_ARGUMENT,
              errors.InvalidArgumentError,
          ),
          (grpc.StatusCode.NOT_FOUND, errors.NotFoundError),
          (
              grpc.StatusCode.PERMISSION_DENIED,
              errors.PermissionDeniedError,
          ),
      ]
      for code, error_type in cases:
          with self.subTest(code.name):
              msg = "my favorite cause"
              e = _grpc_error(code, msg)
              self.stub.ListPlugins.side_effect = [e]
              with self.assertRaises(error_type) as cm:
                  self.provider.list_plugins(
                      self.ctx, experiment_id="123"
                  )
              self.assertIn(msg, str(cm.exception))
  
      internal = grpc.StatusCode.INTERNAL
      with self.subTest(internal.name):
          e = _grpc_error(internal, "oops")
          self.stub.ListPlugins.side_effect = [e]
          with self.assertRaises(grpc.RpcError):
              self.provider.list_plugins(self.ctx, experiment_id="123")
  
imports: from unittest import mock
  import grpc
  import grpc_testing
  import numpy
  from tensorboard import errors
  from tensorboard import test
  from tensorboard import context
  from tensorboard.data import grpc_provider
  from tensorboard.data import provider
  from tensorboard.data.proto import data_provider_pb2
  from tensorboard.data.proto import data_provider_pb2_grpc
  from tensorboard.util import tensor_util
label_desc: Use image node_id 16 for calling the GrpcDataProviderTest obj's underlying member method code with example usage: obj.test_rpc_error() without return types