Improve error handling

This will report errors with template filenames in it and therefore improves errors happening in files a lot. 
Having the line number there would be even better, but I couldn't figure out a way how to do this. 

related: #463