code: def test_log_errors(
      tmp_dir,
      scm,
      dvc,
      capsys,
      run_copy_metrics,
      file,
      error_path,
      err_type,
  ):
      tmp_dir.gen("metrics_t.yaml", "m: 1.1")
      run_copy_metrics(
          "metrics_t.yaml",
          "metrics.yaml",
          metrics=["metrics.yaml"],
          single_stage=False,
          name="train",
      )
      scm.tag("v1")
  
      with open(file, "a", encoding="utf-8") as fd:
          fd.write("\nMALFORMED!")
  
      assert main(["metrics", "show", "--all-tags", "--json"]) == 0
  
      out, error = capsys.readouterr()
      result = json.loads(out)
  
      assert get_in(result, error_path) == err_type
      assert (
          "DVC failed to load some metrics for following revisions: 'workspace'."
          in error
      )
  
imports: import json
  import os
  from os.path import join
  import pytest
  from funcy import get_in
  from dvc.cli import main
  from dvc.dvcfile import PROJECT_FILE
  from dvc.exceptions import OverlappingOutputPathsError
  from dvc.repo import Repo
  from dvc.utils.fs import remove
  from dvc.utils.serialize import JSONFileCorruptedError
label_desc: Use image node_id 19 for calling a global function with example usage: test_log_errors(tmp_dir, scm, dvc, capsys, run_copy_metrics, file, error_path, err_type) without return types