class_docstr: An iterator over Train results. Returned by ``trainer.run_iterator``.
class_docstr_tok: ["An","iterator","over","Train","results",".","Returned","by","``","trainer.run_iterator","``","."]
code: def _run_with_error_handling(self, func: Callable):
      try:
          return func()
      except TrainingWorkerError:
          # TODO(ml-team): This Train fault-tolerance code doesn't get used
          # since max_retries=0
          # Workers have already been restarted.
          logger.info(
              "Workers have been successfully restarted. Resuming "
              "training from latest checkpoint."
          )
          self._start_training(
              self._train_func,
              self._datasets,
              self._metadata,
              self._data_config,
          )
          return self._run_with_error_handling(func)
      except InactiveWorkerGroupError:
          raise RuntimeError(
              "This Trainer is not active. It is either shutdown "
              "already or never started in the first place. "
              "Either create a new Trainer or start this one."
          ) from None
      except TrainBackendError:
          raise RuntimeError(
              "Training failed. You should not be seeing "
              "this error and this is a bug. Please create "
              "a new issue at "
              "https://github.com/ray-project/ray."
          ) from None
  
imports: import logging
  from pathlib import Path
  from typing import Any, Callable, Dict, List, Optional, TypeVar, Union
  from ray.air._internal.util import StartTraceback
  from ray.data import Dataset
  from ray.train import Checkpoint, DataConfig
  from ray.train._internal.backend_executor import BackendExecutor, InactiveWorkerGroupError, TrainBackendError, TrainingWorkerError
  from ray.train._internal.session import _TrainingResult, _TrainSession, get_session
  from ray.train._internal.utils import ActorWrapper
  from ray.train.backend import BackendConfig
  from ray.train.base_trainer import BaseTrainer, GenDataset, TrainingFailedError
  from ray.util.annotations import DeveloperAPI
label_desc: Use image node_id 4 for calling the TrainingIterator obj's underlying member method code with example usage: obj._run_with_error_handling(func) and returns: func, self