Allow error catch usage

Make it possible that templates can define error
catchers to help debug when a template goes bad
or some issue is occurring inside a template.

Change-Id: Iac211be037a1f4ceb54b477483d99623c4827f3a