Add master exception handling to template.