class_docstr: Raised if a yaml file does not correspond to the expected schema.
class_docstr_tok: ["Raised","if","a","yaml","file","does","not","correspond","to","the","expected","schema","."]
code: def __str__(self) -> Text:
      msg = ""
      if self.filename:
          msg += f"Failed to validate '{self.filename}'. "
      else:
          msg += "Failed to validate YAML. "
      msg += self.message
      if self.validation_errors:
          unique_errors = {}
          for error in self.validation_errors:
              line_number = self._line_number_for_path(
                  self.content, error.path
              )
  
              if line_number and self.filename:
                  error_representation = (
                      f"  in {self.filename}:{line_number}:\n"
                  )
              elif line_number:
                  error_representation = f"  in Line {line_number}:\n"
              else:
                  error_representation = ""
  
              error_representation += f"      {error}"
              unique_errors[str(error)] = error_representation
          error_msg = "\n".join(unique_errors.values())
          msg += f":\n{error_msg}"
      return msg
  
imports: import logging
  import os
  from typing import Text, Dict, List, Optional, Any
  from packaging import version
  from packaging.version import LegacyVersion
  from pykwalify.errors import SchemaError
  from ruamel.yaml.constructor import DuplicateKeyError
  import rasa.shared
  from rasa.shared.exceptions import YamlException, YamlSyntaxException, SchemaValidationError
  import rasa.shared.utils.io
  from rasa.shared.constants import DOCS_URL_TRAINING_DATA, PACKAGE_NAME, LATEST_TRAINING_DATA_FORMAT_VERSION, SCHEMA_EXTENSIONS_FILE, RESPONSES_SCHEMA_FILE
label_desc: Use image node_id 2 for calling the YamlValidationException obj's underlying member method code with example usage: obj.__str__() and returns: msg