mwunsch / handlebars.scala

A Scala implementation of the Handlebars templating language (a superset of Mustache).
Apache License 2.0
112 stars 40 forks source link

Way to access visitor errors #70

Open olivierdeckers opened 7 years ago

olivierdeckers commented 7 years ago

In the current implementation, errors are logged using slf4j. For example, if a value cannot be found in the context, it is just omitted from the result. I would like to obtain a list of the values that could not be found.

What would be the best way to implement this in your opinion?

olivierdeckers commented 7 years ago

I added this feature, and created a pull request: #71 I ended up implementing it by adding an optional field to the visitor. If it is defined, errors will be accumulated in it. If it is not defined, nothing will happen. The change should be backwards compatible since I introduced a separate renderStrict method