Skip to content

YAML parse errors should show line number #336

@leedm777

Description

@leedm777

Detailed description

When handling YAML parse exceptions, instead of just displaying the exception message to the user, it would be super helpful to display the line number(s) of the parse error so the user can figure out what's going on.

Context

Because of eemeli/yaml#114, my valid YAML file was failing to parse. But without specific line number information, and with everything else showing that my YAML file was fine, I had a difficult time figuring out what the problem actually was.

Line numbers in the parse error message would have been fantastic.

Possible implementation

yaml.parse() takes prettyErrors: true as an option, which includes line number information in the exception.

Your environment

  • Node Version: v10.15.3
  • Operating system and version (e.g. Ubuntu 16.04, Windows 7): MacOS

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions