hook up error handling to template from view