throw template exception on compile error