Though Ansible itself has a way for triggering a custom error, I can not find anything similar for Jinja.
My current method uses a syntax error:
{% if 'ansible_mounts' in hostvars[host] %}
# {{ host }} knows its mount-points
{% else %}
# {% error!! No ansible_mounts listed for host - fact-gathering must've failed %}
{% endif %}
but those are rendered poorly at run-time -- one needs to look inside the template-file and search for the error (the rendering does not even include the line-number!).
Is there a way to output a neat failure message from inside Jinja-template?