You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
TTP doesn't include a mechanism for validating template syntax #136
Currently it seems there's no concrete way to be sure a template is valid before you throw data at it. The library currently seems to prefer swallowing errors and returning empty values and maybe logging errors.
as a standalone utility this is reasonable, but for my use case it's unpleasant.
I'm writing code that is going to maintain a library of templates, users can add/remove templates and it'd be very handy if I could explicitly reject obviously invalid templates at the start, rather than waiting for users to try and use them.
Perhaps I can just check the template to see if it's empty, or watch the log stream somehow, but both of those feel pretty messy.
Would you be open to a PR adding a 'strict' parameter making sure most exceptions are raised to the caller, rather than being caught and logged?
Hello, if template is invalid TTP with throw an error when trying to load it. Empty values normally returned not because of the template syntaxis is invalid but because parsing given data with the template produced no output. No output produced by parsing depending on the use case could be an indication of a problem or could be not. It is fairly trivial to add a check for empty results and raise an error in your code.
Do you have examples of error-some data+template combination that don't behave or throw error as expected?
Activity
dmulyalin commentedon Jan 30, 2026
Hello, if template is invalid TTP with throw an error when trying to load it. Empty values normally returned not because of the template syntaxis is invalid but because parsing given data with the template produced no output. No output produced by parsing depending on the use case could be an indication of a problem or could be not. It is fairly trivial to add a check for empty results and raise an error in your code.
Do you have examples of error-some data+template combination that don't behave or throw error as expected?