loop exception custom error template