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

Missing error.source for 'SyntaxError: Document is not valid YAML (bad indentation?)' #5

Closed
ikatyang opened this issue May 28, 2018 · 1 comment

Comments

@ikatyang
Copy link
Contributor

I'm not sure if this is intended, but if so, is it safe to rely on that error.source === null means the error range is the entire document?

@eemeli
Copy link
Owner

eemeli commented May 28, 2018

That error was hopefully the only one that did not have a proper source, but it does now.

The error means that the input string could not be parsed into a single root object, probably because of a typo in indentation or mixing map & seq values in a collection. The node it should now point to is the first one past the discontinuity.

If you do still manage to get a null source, then yes, that can be interpreted to mean that there's something wrong with the whole document. But it should not happen.

@eemeli eemeli closed this as completed May 28, 2018
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