fix error handling in html2text