Adding try except statements in html_txt, html_pdf and txt_html