Throw a more user-friendly exception during template rendering process.
Merge pull request #4541 from Kami/improve_template_render_error_messages

Make errors which get thrown during template rendering more user-friendly