code: def error_translator(e):
      """Translate the tensor_slice_reader.cc errors."""
      # TODO(b/143319754): Remove the RuntimeError casting logic once we resolve the
      # issue with throwing python exceptions from C++.
      error_message = str(e)
      if (
          "not found in checkpoint" in error_message
          or ("Failed to find any " "matching files for")
          in error_message
      ):
          raise errors_impl.NotFoundError(None, None, error_message)
      elif (
          "Sliced checkpoints are not supported" in error_message
          or ("Data type " "not " "supported") in error_message
      ):
          raise errors_impl.UnimplementedError(
              None, None, error_message
          )
      elif "Failed to get matching files on" in error_message:
          raise errors_impl.InvalidArgumentError(
              None, None, error_message
          )
      elif "Unable to open table file" in error_message:
          raise errors_impl.DataLossError(None, None, error_message)
      elif (
          "Failed to find the saved tensor slices" in error_message
          or ("not convertible to numpy dtype" in error_message)
      ):
          raise errors_impl.InternalError(None, None, error_message)
      else:
          raise errors_impl.OpError(
              None, None, error_message, errors_impl.UNKNOWN
          )
  
file_path: tensorflow/tensorflow/python/training/py_checkpoint_reader.py
imports: from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import errors_impl
  from tensorflow.python.util import compat
  from tensorflow.python.util._pywrap_checkpoint_reader import CheckpointReader
  from tensorflow.python.util.tf_export import tf_export
label_desc: Use image node_id 1 for calling a global function with example usage: error_translator(e) without return types