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

Distinguish between Jsonnet parse and runtime errors #66

Open
lawrencejones opened this issue Dec 6, 2023 · 0 comments
Open

Distinguish between Jsonnet parse and runtime errors #66

lawrencejones opened this issue Dec 6, 2023 · 0 comments

Comments

@lawrencejones
Copy link
Member

Just had a funny realisation that when we load files and try Jsonnet first, if Jsonnet fails because of a runtime error (as opposed to, for example, a parser error) then we'll fallback to YAML.

Sadly, YAML will accept almost anything, including valid Jsonnet. So we end up awkwardly parsing Jsonnet as YAML which is unlikely to be what people want at all 😂

We should ensure that if the Jsonnet error is a runtime error we don't try parsing it as YAML.

Example is:

{
  key: error 'oh no',
}

Which YAML will parse happily as:

{
  "key": "error 'oh no',"
}
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

1 participant