def METHOD_NAME(tmp_dir, scm, dvc, capsys, file, error_path):
    tmp_dir.gen("params_other.yaml", "foo: bar")
    dvc.run(
        cmd="echo params_other.yaml",
        params=["params_other.yaml:foo"],
        name="train",
    )
    rename = (tmp_dir / file).read_text()
    with open(tmp_dir / file, "a", encoding="utf-8") as fd:
        fd.write("\nmalformed!")
    scm.add([PROJECT_FILE, "params_other.yaml"])
    scm.commit("init")
    scm.tag("v1")
    (tmp_dir / file).write_text(rename)
    result = dvc.params.show(revs=["v1"])
    _, error = capsys.readouterr()
    assert isinstance(
        reduce(operator.getitem, error_path, result), YAMLFileCorruptedError
    )
    assert "DVC failed to load some parameters for following revisions: 'v1'." in error