Skip to content

Is it possible to throw an error when a tag inside a template is missing? #69

@acecilia

Description

@acecilia

Is it possible to throw an error when a tag inside a template is missing? I could not find any issues mentioning this topic.

For example, using the example in the readme as a reference, instead of:

let template = try Template(string: "<{{#value}}Truthy{{/value}}>")
// "<>"
try template.render([:])                  // missing value

do:

let template = try Template(string: "<{{#value}}Truthy{{/value}}>")
// Throw error: missing value
try template.render([:])                  // missing value

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions