asteris-llc / converge

A powerful and easy-to-use configuration management system.
Apache License 2.0
250 stars 31 forks source link

Unterminated raw string before another raw string reports bad character #621

Open zeisss opened 7 years ago

zeisss commented 7 years ago

This was a very confusing error for me:

task "foo" {
    apply = "echo {{param `foo}} {{param `bar`}}"
}

Error:

* root/module.bootstrap/module.node-exporter/task.foo: template: DependencyTemplate:1: bad character U+0060 '`' file=test.hcl

Maybe it is possible to detect some bad combination of raw strings and make the error more clearly?

rebeccaskinner commented 7 years ago

Checking for balanced quotes and braces shouldn't be terribly difficult before we run templates through the processor. I'll take a look at this soon (or I'm happy to help you work through getting a PR together if you'd like to dig into the code yourself).

Thanks!