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

Improvements/error management #111

Merged
merged 6 commits into from
Mar 17, 2020
Merged

Improvements/error management #111

merged 6 commits into from
Mar 17, 2020

Conversation

jocgir
Copy link
Contributor

@jocgir jocgir commented Mar 17, 2020

Some errors were not reported correctly. If a system call returned multi-line error, only the first line was kept.
struct keyword has been added as a go reserved keyword (this avoided using a variable named struct)

jocgir added 3 commits May 21, 2019 04:48
- Internal template should handle <no value> error
- ellipsis error should only report the error, not the file position
- Add debugging information on error retry
- Multiline errors were not handled properly due to a bad regex conversion
- Add more flexibility to set options on template
- assert method has been renamed to avoid conflict with assert test package
@jocgir jocgir requested a review from julienduchesne March 17, 2020 15:42
@jocgir jocgir force-pushed the improvements/error-management branch from a3cd941 to 190dcd6 Compare March 17, 2020 15:59
{"Invalid", "@typeOf(data(`\"a\": 1, \"b\": 2`))", `"<RUN_ERROR>"`, fmt.Errorf("")},
{"Json", "@typeOf(data(`{\"a\": 1, \"b\": 2}`))", "json.jsonDict", nil},
{"Yaml", "@typeOf(data(`a: 1\nb: 2`))", "yaml.yamlDict", nil},
{"Flexible Hcl", "@typeOf(data(`a = 1 b = hello`))", "yaml.yamlDict", nil}, // TODO: Change that to hcl
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO for now or later?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shit, I really don't remember. I merged an old branch that has never been submitted as a PR.
I would say later. I think that I wrote that test when I started to look at HCL2 when it was still in Beta IIRC.

@@ -17,18 +17,25 @@ const (
literalTripleBackticks = "_=!TRIPLE_BT!=_"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ and triple backticks can't go in the reservedKeywords slice below?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so. Too risky to induce side effects IMO.

@jocgir jocgir merged commit 3ab17c8 into master Mar 17, 2020
@jocgir jocgir deleted the improvements/error-management branch March 17, 2020 18:58
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

Successfully merging this pull request may close these issues.

2 participants