(
    source_file: SchemaSourceFile
)
If loading the yaml fails, raise an exception.
If loading the yaml fails, raise an exception.
If loading the yaml fails raise an exception .
def yaml_from_file(
    source_file: SchemaSourceFile
) -> Dict[str, Any]:
    """If loading the yaml fails, raise an exception.
    """
    path = source_file.path.relative_path
    try:
        return load_yaml_text(source_file.contents)
    except ValidationException as e:
        reason = validator_error_message(e)
        raise ParsingException(
            'Error reading {}: {} - {}'
            .format(source_file.project_name, path, reason)
        )
def yaml_from_file ( source_file : SchemaSourceFile ) -> Dict [ str , Any ] : path = source_file . path . relative_path try : return load_yaml_text ( source_file . contents ) except ValidationException as e : reason = validator_error_message ( e ) raise ParsingException ( 'Error reading {}: {} - {}' . format ( source_file . project_name , path , reason ) )