Added handling exceptions raised during rendering templates