callback based error template generator