This adds a scope event notification when a template fails to load. This can have performance implications, and unfortunately cannot at this moment be terminated with preventDefault(). But it's nice to be notified when problems occur! Closes #5803
@kind function
@function