EZP-23212 Enhanced template error handling

JIRA: https://jira.ez.no/browse/EZP-23212
The file and line information is not available for some template errors