Added try catch for template compilation errors during the rendering.