GRMustache.swift icon indicating copy to clipboard operation
GRMustache.swift copied to clipboard

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

Open acecilia opened this issue 6 years ago • 0 comments

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!

acecilia avatar Nov 13 '19 01:11 acecilia