class_docstr: Generator implementation class for SyncPipelineTaskGenerator.
class_docstr_tok: ["Generator","implementation","class","for","SyncPipelineTaskGenerator","."]
docstr: Generates fail tasks for a node.
code: def _update_node_state_to_failed_task(
      self,
      node_uid: task_lib.NodeUid,
      error_code: int,
      error_msg: str,
  ) -> task_lib.Task:
      """Generates fail tasks for a node."""
      error_msg = textwrap.shorten(error_msg, width=512)
      return task_lib.UpdateNodeStateTask(
          node_uid=node_uid,
          state=pstate.NodeState.FAILED,
          status=status_lib.Status(code=error_code, message=error_msg),
      )
  
imports: import collections
  import textwrap
  from typing import Callable, Dict, List, Mapping, Optional, Set
  from absl import logging
  from tfx.orchestration import node_proto_view
  from tfx.orchestration.experimental.core import mlmd_state
  from tfx.orchestration.experimental.core import pipeline_state
  from tfx.orchestration.experimental.core import service_jobs
  from tfx.orchestration.experimental.core import task
  from tfx.orchestration.experimental.core import task_gen
  from tfx.orchestration.experimental.core import task_gen_utils
  from tfx.orchestration import mlmd_connection_manager
  from tfx.orchestration.portable.input_resolution import exceptions
  from tfx.orchestration.portable.mlmd import execution_lib
  from tfx.proto.orchestration import pipeline_pb2
  from tfx.utils import status
  from tfx.utils import topsort
  from ml_metadata.proto import metadata_store_pb2
label_desc: Use image node_id 5 for calling the _Generator obj's underlying member method code with example usage: obj._update_node_state_to_failed_task(node_uid, error_code, error_msg) and returns: task_lib