Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

YAML parse errors should show line number #336

Closed
leedm777 opened this issue May 22, 2019 · 1 comment
Closed

YAML parse errors should show line number #336

leedm777 opened this issue May 22, 2019 · 1 comment

Comments

@leedm777
Copy link

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
@djtarazona
Copy link
Contributor

This has been added in v0.11.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants