Skip to content

No error messages when accessing undefined variables in config templating #70

Description

@mikn

So, poking around in your settings system I noticed that the templates, both on the input from the user-data.toml and to the output in the templates, you use kebab-case, but in rust you use snake_case (few programming languages allow you to use kebab-case, I guess).

This took me an embarrassingly long time to figure out (I just assumed that since it was decoded into rust structs with snake_case, that the templating would use snake_case also).

Ultimately, what was not ergonomic in this was that I got no real error when trying to access template variables that does not exist and is not set. You do take great care to validate it in Rust, etc - perhaps there is a way to make sure that when accessing variables in the templating stage, that you check that the variable exists? Would have saved me a lot of time!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions