Catch jinja2.exceptions.UndefinedError

This commit suppresses a traceback that occurs when there is an
undefined jinja variable used in a template. Unfortunately, it does not
seem that this exception class captures the name of the undefined
variable, which would be useful information, so a mention of the line
number in which the exception was found will have to be sufficient.
Clarify templating documentation for file states
Merge pull request #6241 from terminalmage/issue6020

Catch jinja2.exceptions.UndefinedError